forked from saurabh/personal-research
Merge branch 'master' into 'master'
add link to member's front page for both index and show views add link to member's front page for both index and show views See merge request !1
This commit is contained in:
commit
c2bba77a78
|
@ -2,8 +2,10 @@ class PersonalResearchesController < ApplicationController
|
||||||
def index
|
def index
|
||||||
researchs = Research.where(:is_hidden=>false).order_by(:year=>'desc').page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
|
researchs = Research.where(:is_hidden=>false).order_by(:year=>'desc').page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
|
||||||
research_list = researchs.collect do |research|
|
research_list = researchs.collect do |research|
|
||||||
|
member = research.member_profile
|
||||||
|
path = OrbitHelper.url_to_plugin_show(member.to_param, 'member') rescue '#'
|
||||||
{
|
{
|
||||||
"member" => (research.member_profile.name rescue ""),
|
"member" => "<a href='#{path}'>#{member.name}</a>",
|
||||||
"year" => research.year,
|
"year" => research.year,
|
||||||
"publication_date" => (research.publish_date.strftime("%Y.%m") rescue ""),
|
"publication_date" => (research.publish_date.strftime("%Y.%m") rescue ""),
|
||||||
"research_title" => research.research_title,
|
"research_title" => research.research_title,
|
||||||
|
@ -78,4 +80,4 @@ class PersonalResearchesController < ApplicationController
|
||||||
# }
|
# }
|
||||||
# }
|
# }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -110,6 +110,9 @@ class Research
|
||||||
files << "<li><a href='#{url}' target='_blank'>#{title}</li>"
|
files << "<li><a href='#{url}' target='_blank'>#{title}</li>"
|
||||||
end
|
end
|
||||||
value = files.join("")
|
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
|
else
|
||||||
value = self.send(field) rescue ""
|
value = self.send(field) rescue ""
|
||||||
end
|
end
|
||||||
|
@ -133,4 +136,4 @@ class Research
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue