Merge branch 'master' into 'master'

fix showing author error for admin's index



See merge request !5
This commit is contained in:
wmcheng 2019-11-13 13:36:55 +08:00
commit 7be5334673
2 changed files with 5 additions and 2 deletions

View File

@ -3,11 +3,14 @@ module Admin::JournalPapersHelper
(journal.authors.to_s.blank? ? get_member(journal).collect(&:name).join('/') : Nokogiri::HTML(journal.authors.to_s).text rescue "") (journal.authors.to_s.blank? ? get_member(journal).collect(&:name).join('/') : Nokogiri::HTML(journal.authors.to_s).text rescue "")
end end
def get_authors_show(journal) def get_authors_show(journal)
(journal.authors.to_s.blank? ? get_member(journal).collect{|member| "<a href='#{OrbitHelper.url_to_plugin_show(member.to_param,'member')}' title='#{member.name}'>#{member.name}</a>"}.join('/') : (journal.authors.to_s) rescue "") (journal.authors.to_s.blank? ? get_member_show(journal) : (journal.authors.to_s) rescue "")
end end
def get_member(journal) def get_member(journal)
Array(MemberProfile.find(Array(journal).collect(&:member_profile_id))) Array(MemberProfile.find(Array(journal).collect(&:member_profile_id)))
end end
def get_member_show(journal)
get_member(journal).collect{|member| "<a href='#{OrbitHelper.url_to_plugin_show(member.to_param,'member')}' title='#{member.name}'>#{member.name}</a>"}.join('/')
end
def get_level_type(journal) def get_level_type(journal)
!journal.journal_levels.blank? ? "(#{journal.journal_levels.collect(&:title).join(', ')})" : nil !journal.journal_levels.blank? ? "(#{journal.journal_levels.collect(&:title).join(', ')})" : nil
end end

View File

@ -14,6 +14,6 @@
</ul> </ul>
</div> </div>
</td> </td>
<td><%= writing_journal.member_profile.name rescue "" %></td> <td><%= get_member_show(writing_journal).html_safe %></td>
</tr> </tr>
<% end %> <% end %>