Update journal_papers_helper.rb

This commit is contained in:
chiu 2019-11-01 14:40:13 +08:00
parent d9ef7c5585
commit 9bdc47e315
1 changed files with 15 additions and 0 deletions

View File

@ -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")