Update personal_journals_controller.rb
This commit is contained in:
parent
282a99ba56
commit
7d66f3b766
|
@ -32,34 +32,9 @@ class PersonalJournalsController < ApplicationController
|
||||||
page_to_show = params[:page_no].to_i
|
page_to_show = params[:page_no].to_i
|
||||||
end
|
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_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count]
|
||||||
journal_paper_list = []
|
journal_papers = journal_papers_show_last
|
||||||
journal_papers_show_last.each do |journal_paper|
|
|
||||||
t = []
|
|
||||||
fields_to_show.each do |fs|
|
|
||||||
case fs
|
|
||||||
when "paper_title"
|
|
||||||
if page.custom_string_field == "table"
|
|
||||||
t << {"value" => "<a href='#{OrbitHelper.url_to_show([journal_paper[fs],journal_paper[:uid]].to_param)}'>#{journal_paper[fs]}</a>"}
|
|
||||||
else
|
else
|
||||||
if journal_paper[fs]!=nil && journal_paper[fs]!=""
|
|
||||||
t << {"value" => "<a href='#{OrbitHelper.url_to_show([journal_paper[fs],journal_paper[:uid]].to_param)}'>#{journal_paper[fs]}, #{journal_paper[:journal_title][params[:locale]]}</a>"}
|
|
||||||
else
|
|
||||||
t << {"value" => "<a href='#{OrbitHelper.url_to_show([journal_paper[fs],journal_paper[:uid]].to_param)}'>#{journal_paper[fs]}</a>"}
|
|
||||||
end
|
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[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[fs]}"}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
journal_paper_list << {"jps" => t}
|
|
||||||
end
|
|
||||||
else
|
|
||||||
journal_paper_list = []
|
journal_paper_list = []
|
||||||
journal_papers.each do |journal_paper|
|
journal_papers.each do |journal_paper|
|
||||||
t = []
|
t = []
|
||||||
|
@ -83,7 +58,6 @@ class PersonalJournalsController < ApplicationController
|
||||||
end
|
end
|
||||||
journal_paper_list << {"jps" => t}
|
journal_paper_list << {"jps" => t}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
headers = []
|
headers = []
|
||||||
choice_show = []
|
choice_show = []
|
||||||
fields_to_show.each do |fs|
|
fields_to_show.each do |fs|
|
||||||
|
|
Loading…
Reference in New Issue