From f6e74071ce66b56eee758d6609df8c2eab57871f Mon Sep 17 00:00:00 2001 From: Eric Tsai Date: Tue, 31 Dec 2019 15:18:40 +0800 Subject: [PATCH 1/4] change to new member front page generator --- app/controllers/personal_honors_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_honors_controller.rb b/app/controllers/personal_honors_controller.rb index 608ac8a..5313e98 100644 --- a/app/controllers/personal_honors_controller.rb +++ b/app/controllers/personal_honors_controller.rb @@ -35,7 +35,7 @@ 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 '#' + link = OrbitHelper.url_to_plugin_show(member_profile.to_param, 'member') rescue '#' t << {"value" => "" + (member_profile.name rescue "") + "" } when "award_date" t << {"value" => (honor.send(fs).strftime("%Y/%m") rescue "")} From 876c93e59152cbc1783c2c185ed88a720c09dba4 Mon Sep 17 00:00:00 2001 From: Eric Tsai Date: Tue, 31 Dec 2019 15:59:38 +0800 Subject: [PATCH 2/4] add link to honoree front page for current honor --- app/models/honor.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/honor.rb b/app/models/honor.rb index 17fb646..52a47c9 100644 --- a/app/models/honor.rb +++ b/app/models/honor.rb @@ -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') + value = "" + self.member_profile.name + "" when "language" value = I18n.t(self.language) rescue "" when "honor_type" @@ -129,4 +130,4 @@ class Honor end end -end \ No newline at end of file +end From 7a36c0ee2eeaec29029fdf687f0fe244a2fd6ba4 Mon Sep 17 00:00:00 2001 From: Eric Tsai Date: Tue, 31 Dec 2019 16:11:19 +0800 Subject: [PATCH 3/4] add exception solution --- app/models/honor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/honor.rb b/app/models/honor.rb index 52a47c9..536f1f7 100644 --- a/app/models/honor.rb +++ b/app/models/honor.rb @@ -99,7 +99,7 @@ class Honor def get_plugin_field_data(field) case field when "honoree" - path = OrbitHelper.url_to_plugin_show(self.member_profile.to_param, 'member') + path = OrbitHelper.url_to_plugin_show(self.member_profile.to_param, 'member') rescue '#' value = "" + self.member_profile.name + "" when "language" value = I18n.t(self.language) rescue "" From 7eb2bf68334648e6fc1ce9b7470a3580fc31b9f1 Mon Sep 17 00:00:00 2001 From: Eric Tsai Date: Tue, 31 Dec 2019 16:11:54 +0800 Subject: [PATCH 4/4] change link to path --- app/controllers/personal_honors_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_honors_controller.rb b/app/controllers/personal_honors_controller.rb index 5313e98..3b3104b 100644 --- a/app/controllers/personal_honors_controller.rb +++ b/app/controllers/personal_honors_controller.rb @@ -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.url_to_plugin_show(member_profile.to_param, 'member') rescue '#' - t << {"value" => "" + (member_profile.name rescue "") + "" } + path = OrbitHelper.url_to_plugin_show(member_profile.to_param, 'member') rescue '#' + t << {"value" => "" + (member_profile.name rescue "") + "" } when "award_date" t << {"value" => (honor.send(fs).strftime("%Y/%m") rescue "")} else