Merge branch 'master' into 'master'

add link to honoree for show; use another front page url generator for index; naming change

add link to honoree for show;
use another front page url generator for index;
naming change

See merge request !3
This commit is contained in:
EricTYL 2019-12-31 16:19:49 +08:00
commit c20baa8be3
2 changed files with 5 additions and 4 deletions

View File

@ -35,8 +35,8 @@ class PersonalHonorsController < ApplicationController
when "authors"
member_profile = honor.send(:member_profile)
role_status_id = member_profile.role_status_ids.first.to_s
link = OrbitHelper.member_url_to_show(member_profile.to_param, role_status_id) rescue '#'
t << {"value" => "<a href='#{link}'>" + (member_profile.name rescue "") + "</a>" }
path = OrbitHelper.url_to_plugin_show(member_profile.to_param, 'member') rescue '#'
t << {"value" => "<a href='#{path}'>" + (member_profile.name rescue "") + "</a>" }
when "award_date"
t << {"value" => (honor.send(fs).strftime("%Y/%m") rescue "")}
else

View File

@ -99,7 +99,8 @@ class Honor
def get_plugin_field_data(field)
case field
when "honoree"
value = self.member_profile.name
path = OrbitHelper.url_to_plugin_show(self.member_profile.to_param, 'member') rescue '#'
value = "<a href='#{path}'>" + self.member_profile.name + "</a>"
when "language"
value = I18n.t(self.language) rescue ""
when "honor_type"
@ -129,4 +130,4 @@ class Honor
end
end
end
end