Fix link.

This commit is contained in:
BoHung Chiu 2022-12-15 17:35:42 +08:00
parent 86f0d507bf
commit 61a8f79ca4
1 changed files with 4 additions and 2 deletions

View File

@ -75,9 +75,11 @@ class Experience
pd_data = []
fields_to_show.collect do |t|
if t == "organizationt_title"
pd_data << { "data_title" => "<a href=\"#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_experience')}\" title=\"#{p.send(t)}\" target='_blank'>#{p.send(t)}</a>" }
link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_experience')
url_to_plugin_show_blank = OrbitHelper.instance_variable_get(:@url_to_plugin_show_blank)
tmp_title = p.organizationt_title
pd_data << { "data_title" => (url_to_plugin_show_blank ? tmp_title : "<a title=\"#{tmp_title}\" href=\"#{link}\" target=\"_blank\">#{tmp_title}") }
elsif t == "duration"
if !p.send('start_date').nil? or !p.send('end_date').nil?
start_date = ((p.send('start_date').blank?) ? "" : p.send('start_date').strftime('%Y.%m')) rescue ""
end_date = ((p.send('end_date').blank? || p.send('end_date').to_s == "0000-01-01" ) ? I18n.t('personal_experience.up_to_today') : p.send('end_date').strftime('%Y.%m')) rescue I18n.t('personal_experience.up_to_today')