From 9bdc47e3151fa97a939b51e784eee743ca728c30 Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 1 Nov 2019 14:40:13 +0800 Subject: [PATCH] Update journal_papers_helper.rb --- app/helpers/admin/journal_papers_helper.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/helpers/admin/journal_papers_helper.rb b/app/helpers/admin/journal_papers_helper.rb index a5abbbb..c053400 100644 --- a/app/helpers/admin/journal_papers_helper.rb +++ b/app/helpers/admin/journal_papers_helper.rb @@ -1,4 +1,19 @@ module Admin::JournalPapersHelper + def get_member(journal) + Array(MemberProfile.find(journal.member_profile_id)) + end + def get_level_type(journal) + !journal.journal_levels.blank? ? "(#{journal.journal_levels.collect(&:title).join(', ')})" : nil + end + def get_author_type(journal) + journal.journal_paper_author_types.collect(&:title).join(', ') rescue '' + end + def get_paper_type(journal) + journal.journal_paper_type.title rescue '' + end + def get_publication_date(journal) + journal.publication_date.strftime('%Y/%m/%d') rescue '' + end def page_for_journal_paper(journal_paper_object) journal_paper_page = nil pages = Page.where(:module=>"journal_paper")