From 3ba5e45a4c26a93cf0fc1eec99267c3b807c726b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Thu, 30 Dec 2021 15:16:40 +0800 Subject: [PATCH] fix error --- app/models/journal_paper.rb | 8 ++++++-- app/views/plugin/personal_journal/_profile.html.erb | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/models/journal_paper.rb b/app/models/journal_paper.rb index bcce783..943884b 100644 --- a/app/models/journal_paper.rb +++ b/app/models/journal_paper.rb @@ -119,7 +119,9 @@ class JournalPaper if !page.nil? && page.custom_string_field == "table" case t when "paper_title" - pd_data << { "data_title" => "#{p.paper_title}" } + link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_journal') + paper_title = link=='#' ? p.paper_title : "#{p.paper_title}" + pd_data << { "data_title" => paper_title } when "level_type" pd_data << {"data_title" => ( !p.journal_levels.blank? ? "(#{p.journal_levels.collect{|x| x.title}.join(', ')})" : nil)} when "publication_date" @@ -131,7 +133,9 @@ class JournalPaper end else if t == "paper_title" - pd_data << { "data_title" => "#{p.create_link}" } + link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_journal') + paper_title = link=='#' ? p.paper_title : "#{p.create_link}" + pd_data << { "data_title" => paper_title } else pd_data << { "data_title" => p.send(t) } end diff --git a/app/views/plugin/personal_journal/_profile.html.erb b/app/views/plugin/personal_journal/_profile.html.erb index 1af5d4f..6d78feb 100644 --- a/app/views/plugin/personal_journal/_profile.html.erb +++ b/app/views/plugin/personal_journal/_profile.html.erb @@ -44,7 +44,8 @@ <% end -%> <%= writing_journal.year %> - <%= link_to writing_journal.create_link, OrbitHelper.url_to_plugin_show(writing_journal.to_param,'personal_journal'), target: "blank"%> + <% link = OrbitHelper.url_to_plugin_show(writing_journal.to_param,'personal_journal') %> + <%= link=='#' ? writing_journal.create_link : link_to writing_journal.create_link, link, target: "blank"%>