forked from saurabh/personal-journal
Update personal_journals_controller.rb
This commit is contained in:
parent
b700749a2f
commit
d7a50ef0fe
|
@ -30,20 +30,20 @@ class PersonalJournalsController < ApplicationController
|
||||||
case params[:selectbox]
|
case params[:selectbox]
|
||||||
when "paper_title","default"
|
when "paper_title","default"
|
||||||
if page.custom_string_field == "table"
|
if page.custom_string_field == "table"
|
||||||
journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.paper_title,params[:keywords])}
|
journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.paper_title, params[:keywords])}
|
||||||
else
|
else
|
||||||
journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.create_link,params[:keywords])}
|
journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.create_link, params[:keywords])}
|
||||||
end
|
end
|
||||||
when "level_type"
|
when "level_type"
|
||||||
journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_levels.collect{|x| x.title}.join(', ').to_s,params[:keywords])}
|
journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_levels.collect{|x| x.title}.join(', ').to_s, params[:keywords])}
|
||||||
when "publication_date"
|
when "publication_date"
|
||||||
journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', '),params[:keywords])}
|
journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send("publication_date").strftime("%Y/%m/%d"), params[:keywords])}
|
||||||
when "author_type"
|
when "author_type"
|
||||||
journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_author_types.collect{|jat| jat.title}.join(", "),params[:keywords])}
|
journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_author_types.collect{|jat| jat.title}.join(", "), params[:keywords])}
|
||||||
when "language"
|
when "language"
|
||||||
journal_papers_show = journal_papers_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : ""),params[:keywords])}
|
journal_papers_show = journal_papers_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : ""), params[:keywords])}
|
||||||
else
|
else
|
||||||
journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s,params[:keywords])}
|
journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords])}
|
||||||
end
|
end
|
||||||
if params[:page_no].nil?
|
if params[:page_no].nil?
|
||||||
page_to_show = 1
|
page_to_show = 1
|
||||||
|
|
Loading…
Reference in New Issue