forked from saurabh/personal-lab
Merge branch 'master' into 'master'
add link to member's front page for index and show views add link to member's front page for index and show views See merge request !1
This commit is contained in:
commit
0662c438db
|
@ -2,11 +2,13 @@ class PersonalLabsController < ApplicationController
|
|||
def index
|
||||
labs = Lab.where(:is_hidden=>false).order_by(:year=>'desc').page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
|
||||
lab_list = labs.collect do |lab|
|
||||
member = lab.member_profile
|
||||
path = OrbitHelper.url_to_plugin_show(member.to_param, 'member') rescue '#'
|
||||
{
|
||||
"year" => lab.year,
|
||||
"lab_title" => lab.lab_title,
|
||||
"location" => lab.location,
|
||||
"member" => (lab.member_profile.name rescue ""),
|
||||
"member" => "<a href='#{path}'>#{member.name}</a>",
|
||||
"link_to_show" => OrbitHelper.url_to_show(lab.to_param)
|
||||
}
|
||||
end
|
||||
|
@ -39,6 +41,7 @@ class PersonalLabsController < ApplicationController
|
|||
"extension_no",
|
||||
"url",
|
||||
"note",
|
||||
#"owner",
|
||||
"file"
|
||||
]
|
||||
|
||||
|
|
|
@ -99,6 +99,9 @@ class Lab
|
|||
files << "<li><a href='#{url}'' target='_blank'>#{title}</li>"
|
||||
end
|
||||
value = files.join("")
|
||||
when "owner"
|
||||
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