From f1e57a93aba8bb9c390dadb17417353228a56d47 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 08:51:19 +0800 Subject: [PATCH] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 7f020ad..f42fb6f 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -21,10 +21,10 @@ 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] } + t = Time.now case params[:selectbox] when "paper_title","default" if page.custom_string_field == "table" @@ -43,6 +43,7 @@ class PersonalJournalsController < ApplicationController else journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.upcase.include? params[:keywords].upcase} end + timer = Time.now-t if params[:page_no].nil? page_to_show = 1 else @@ -50,7 +51,6 @@ class PersonalJournalsController < ApplicationController end journal_papers = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] 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