Update personal_journals_controller.rb
This commit is contained in:
parent
d7862784cd
commit
fabd331bdf
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue