add link to member's front page for both index and show views
This commit is contained in:
parent
7771a2e6a6
commit
09f3131eae
|
@ -2,12 +2,14 @@ class PersonalCoursesController < ApplicationController
|
|||
def index
|
||||
courses = Course.where(:is_hidden=>false).order_by(:year=>'desc').page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
|
||||
courses_list = courses.collect do |course|
|
||||
member = course.member_profile
|
||||
path = OrbitHelper.url_to_plugin_show(member.to_param, 'member') rescue '#'
|
||||
{
|
||||
"year" => course.year,
|
||||
"title" => course.title,
|
||||
"category" => (course.course_category.title rescue ""),
|
||||
"semester" => (course.course_semester.title rescue ""),
|
||||
"authors" => (course.member_profile.name rescue ""),
|
||||
"authors" => ("<a href='#{path}'>" + member.name + "</a>"),
|
||||
"link_to_show" => OrbitHelper.url_to_show(course.to_param)
|
||||
}
|
||||
end
|
||||
|
|
|
@ -108,6 +108,9 @@ class Course
|
|||
end
|
||||
end
|
||||
value = files.join("")
|
||||
when "authors"
|
||||
path = OrbitHelper.url_to_plugin_show(self.member_profile.to_param, 'member') rescue '#'
|
||||
value = "<a href='#{path}'>#{self.member_profile.name}</a>"
|
||||
else
|
||||
value = self.send(field) rescue ""
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue