Update personal_journals_controller.rb

This commit is contained in:
chiu 2019-08-13 17:16:37 +08:00
parent ab5b44aafb
commit e7880ea2a1
1 changed files with 27 additions and 25 deletions

View File

@ -47,7 +47,9 @@ class PersonalJournalsController < ApplicationController
end
journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count]
journal_papers = journal_papers_show_last
journal_papers_total_pages = (journal_papers_show.length/OrbitHelper.page_data_count.to_f).ceil
else
journal_papers_total_pages = journal_papers.total_pages
end
journal_paper_list = []
journal_papers.each do |journal_paper|
@ -95,7 +97,7 @@ class PersonalJournalsController < ApplicationController
"journal_papers" => journal_paper_list,
"headers" => headers,
"extras" => {"widget-title" => t("module_name.journal_paper")},
"total_pages" => journal_papers.total_pages,
"total_pages" => journal_papers_total_pages,
"choice" => {"choice_value" => choice_value ,"choice_show" => choice_show},
"url" => "/"+params[:locale]+params[:url],
"all" => journal_papers_show_last