diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb
index bd0ef4c..0cf42fd 100644
--- a/app/controllers/personal_journals_controller.rb
+++ b/app/controllers/personal_journals_controller.rb
@@ -20,30 +20,35 @@ class PersonalJournalsController < ApplicationController
"paper_title"
]
end
- journal_paper_list = []
- journal_papers.each do |journal_paper|
- t = []
- fields_to_show.each do |fs|
- case fs
- when "paper_title"
- if page.custom_string_field == "table"
- t << {"value" => "#{journal_paper.paper_title}"}
- else
- t << {"value" => "#{journal_paper.create_link}"}
+ if params.selectbox != nil
+ journal_papers = Mongoid::Sessions.default[:journal_papers].find()
+ journal_papers_count = journal_papers.count
+ journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count)
+ else
+ journal_paper_list = []
+ journal_papers.each do |journal_paper|
+ t = []
+ fields_to_show.each do |fs|
+ case fs
+ when "paper_title"
+ if page.custom_string_field == "table"
+ t << {"value" => "#{journal_paper.paper_title}"}
+ else
+ t << {"value" => "#{journal_paper.create_link}"}
+ end
+ when "level_type"
+ t << {"value" => ( !journal_paper.journal_levels.blank? ? "(#{journal_paper.journal_levels.collect{|x| x.title}.join(', ')})" : nil)}
+ when "publication_date"
+ t << {"value" => (journal_paper.send(fs).strftime("%Y/%m") rescue "")}
+ when "author_type"
+ t << {"value" => (journal_paper.journal_paper_author_types.collect{|jat| jat.title}.join(", ") rescue "")}
+ else
+ t << {"value" => journal_paper.send(fs)}
+ end
end
- when "level_type"
- t << {"value" => ( !journal_paper.journal_levels.blank? ? "(#{journal_paper.journal_levels.collect{|x| x.title}.join(', ')})" : nil)}
- when "publication_date"
- t << {"value" => (journal_paper.send(fs).strftime("%Y/%m") rescue "")}
- when "author_type"
- t << {"value" => (journal_paper.journal_paper_author_types.collect{|jat| jat.title}.join(", ") rescue "")}
- else
- t << {"value" => journal_paper.send(fs)}
+ journal_paper_list << {"jps" => t}
end
- end
- journal_paper_list << {"jps" => t}
end
-
headers = []
choice_show = []
fields_to_show.each do |fs|
@@ -66,7 +71,7 @@ class PersonalJournalsController < ApplicationController
"total_pages" => journal_papers.total_pages,
"choice" => {"choice_value" => choice_value ,"choice_show" => choice_show},
"url" => "/"+OrbitHelper.params[:locale]+OrbitHelper.params[:url],
- "all" => journal_papers.all.take(journal_papers.all.count)
+ "all" => journal_papers_temp
}
end