forked from saurabh/personal-journal
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
|
||||
end
|
||||
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_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>"}
|
||||
journal_papers = journal_papers_show_last
|
||||
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
|
||||
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_papers.each do |journal_paper|
|
||||
t = []
|
||||
|
@ -83,7 +58,6 @@ class PersonalJournalsController < ApplicationController
|
|||
end
|
||||
journal_paper_list << {"jps" => t}
|
||||
end
|
||||
end
|
||||
headers = []
|
||||
choice_show = []
|
||||
fields_to_show.each do |fs|
|
||||
|
|
Loading…
Reference in New Issue