fix error

This commit is contained in:
邱博亞 2023-03-04 12:14:45 +08:00
parent 4e1adcd0e3
commit 755d395902
2 changed files with 11 additions and 6 deletions

View File

@ -145,8 +145,10 @@ class PersonalJournalsController < ApplicationController
def index_by_author(journal_papers)
journal_papers_total_pages = journal_papers.total_pages
journal_papers_list = journal_papers.group_by{|jp| jp.member_profile.name rescue jp.authors}.collect do |name, jps|
{'name' => name, 'jps' => jps.collect{|jp| {'title' => jp.paper_title}}}
jps_data = jps.collect do |jp|
{'title' => jp.create_link_tag_for_title}
end
{'name' => name, 'jps' => jps_data}
end
{
'journal_papers' => journal_papers_list,

View File

@ -151,10 +151,7 @@ class JournalPaper
end
else
if t == "paper_title"
link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_journal')
url_to_plugin_show_blank = OrbitHelper.instance_variable_get(:@url_to_plugin_show_blank)
tmp_title = p.create_link
pd_data << { "data_title" => (url_to_plugin_show_blank ? tmp_title : "<a title=\"#{tmp_title}\" href=\"#{link}\" target=\"_blank\">#{tmp_title}</a>") }
pd_data << { "data_title" => p.create_link_tag_for_title}
else
pd_data << { "data_title" => p.send(t) }
end
@ -169,6 +166,12 @@ class JournalPaper
return [pd_title,plugin_datas]
end
def create_link_tag_for_title
link = OrbitHelper.url_to_plugin_show(self.to_param,'personal_journal')
url_to_plugin_show_blank = OrbitHelper.instance_variable_get(:@url_to_plugin_show_blank)
tmp_title = self.create_link
(url_to_plugin_show_blank ? tmp_title : "<a title=\"#{tmp_title}\" href=\"#{link}\" target=\"_blank\">#{tmp_title}</a>")
end
# def self.member_data
# members = MemberProfile.all
# member_data = []