From fabd331bdf11b4ef0dbed3dec7d3815f613a1a64 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 08:46:28 +0800 Subject: [PATCH] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index b10ebd9..cd3785b 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -21,6 +21,7 @@ class PersonalJournalsController < ApplicationController ] end if params[:selectbox] !=nil + t = Time.now journal_papers = JournalPaper.where(:is_hidden=>false) journal_papers_count = journal_papers.count journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } @@ -50,6 +51,7 @@ class PersonalJournalsController < ApplicationController 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 + timer = Time.now-t else journal_papers_total_pages = journal_papers.total_pages end @@ -110,7 +112,8 @@ class PersonalJournalsController < ApplicationController "search_text" => search_text, "search_value" => params[:keywords]}, "total_pages" => journal_papers_total_pages, - "choice" => choice + "choice" => choice, + "timer" => timer } end