Update personal_journals_controller.rb

This commit is contained in:
chiu 2019-08-15 08:36:42 +08:00
parent 0557338d20
commit d7862784cd
1 changed files with 8 additions and 9 deletions

View File

@ -27,20 +27,20 @@ class PersonalJournalsController < ApplicationController
case params[:selectbox]
when "paper_title","default"
if page.custom_string_field == "table"
journal_papers_show = journal_papers_temp.select {|value| value.paper_title.include? params[:keywords]}
journal_papers_show = journal_papers_temp.select {|value| value.paper_title.upcase.include? params[:keywords].upcase}
else
journal_papers_show = journal_papers_temp.select {|value| value.create_link.include? params[:keywords]}
journal_papers_show = journal_papers_temp.select {|value| value.create_link.upcase.include? params[:keywords].upcase}
end
when "level_type"
journal_papers_show = journal_papers_temp.select {|value| value.journal_levels.collect{|x| x.title}.join(', ').to_s.include? params[:keywords]}
journal_papers_show = journal_papers_temp.select {|value| value.journal_levels.collect{|x| x.title}.join(', ').to_s.upcase.include? params[:keywords].upcase}
when "publication_date"
journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').include? params[:keywords]}
journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').upcase.include? params[:keywords].upcase}
when "author_type"
journal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").include? params[:keywords]}
journal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").upcase.include? params[:keywords].upcase}
when "language"
journal_papers_show = journal_papers_temp.select {|value| (!value.language.nil? ? t("#{value.language}") : "").include? params[:keywords]}
journal_papers_show = journal_papers_temp.select {|value| (!value.language.nil? ? t("#{value.language}") : "").upcase.include? params[:keywords].upcase}
else
journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]}
journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.upcase.include? params[:keywords].upcase}
end
if params[:page_no].nil?
page_to_show = 1
@ -110,8 +110,7 @@ class PersonalJournalsController < ApplicationController
"search_text" => search_text,
"search_value" => params[:keywords]},
"total_pages" => journal_papers_total_pages,
"choice" => choice,
"trans" => "我是meにっぽんご/にほん".upcase
"choice" => choice
}
end