diff --git a/app/controllers/admin/journal_papers_controller.rb b/app/controllers/admin/journal_papers_controller.rb index d5309cc..8525f33 100644 --- a/app/controllers/admin/journal_papers_controller.rb +++ b/app/controllers/admin/journal_papers_controller.rb @@ -1,5 +1,5 @@ class Admin::JournalPapersController < OrbitMemberController - + include Admin::JournalPapersHelper before_action :set_journal_paper, only: [:show, :edit , :update, :destroy] before_action :get_plugins, only: [:index, :writing_journal_setting, :new, :create, :edit, :update] before_action :set_types, only: [:writing_journal_setting, :new, :edit, :create, :update] diff --git a/app/helpers/admin/journal_papers_helper.rb b/app/helpers/admin/journal_papers_helper.rb index f44d42c..5c40ff1 100644 --- a/app/helpers/admin/journal_papers_helper.rb +++ b/app/helpers/admin/journal_papers_helper.rb @@ -1,2 +1,9 @@ module Admin::JournalPapersHelper + def page_for_journal_paper(journal_paper) + journal_paper_page = nil + pages = Page.where(:module=>"member") + + journal_paper_page = pages.first if journal_paper_page.nil? + request.protocol+(request.host_with_port+journal_paper_page.url+'/'+journal_paper.to_param+"?method=personal_plugin&plugin_name=JournalPaper").gsub('//','/') rescue "/" + end end diff --git a/app/views/admin/journal_papers/_writing_journal.html.erb b/app/views/admin/journal_papers/_writing_journal.html.erb index 469c51f..c19325e 100644 --- a/app/views/admin/journal_papers/_writing_journal.html.erb +++ b/app/views/admin/journal_papers/_writing_journal.html.erb @@ -2,8 +2,7 @@