parent
7b52a160a2
commit
1d60d68aed
|
@ -25,9 +25,7 @@ class PersonalConferencesController < ApplicationController
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
if params[:selectbox] !=nil
|
if params[:selectbox] !=nil
|
||||||
writing_conferences = WritingConference.where(:is_hidden=>false)
|
writing_conferences_temp = WritingConference.where(:is_hidden=>false).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] }
|
||||||
writing_conferences_count = writing_conferences.count
|
|
||||||
writing_conferences_temp = writing_conferences.take(writing_conferences_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] }
|
|
||||||
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"
|
||||||
|
@ -42,7 +40,7 @@ class PersonalConferencesController < ApplicationController
|
||||||
when "period"
|
when "period"
|
||||||
writing_conferences_show = writing_conferences_temp.select {|value| search_all_words(value.duration, params[:keywords])}
|
writing_conferences_show = writing_conferences_temp.select {|value| search_all_words(value.duration, params[:keywords])}
|
||||||
when "publication_date"
|
when "publication_date"
|
||||||
writing_conferences_show = writing_conferences_temp.select {|value| search_all_words(value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', '), params[:keywords])}
|
writing_conferences_show = writing_conferences_temp.select {|value| search_all_words(value.send("publication_date").strftime("%Y/%m/%d").collect{|x| x.title}.join(', '), params[:keywords])}
|
||||||
when "author_type"
|
when "author_type"
|
||||||
writing_conferences_show = writing_conferences_temp.select {|value| search_all_words(value.conference_author_types.collect{|cat| cat.title}.join(", "), params[:keywords])}
|
writing_conferences_show = writing_conferences_temp.select {|value| search_all_words(value.conference_author_types.collect{|cat| cat.title}.join(", "), params[:keywords])}
|
||||||
when "language"
|
when "language"
|
||||||
|
@ -55,8 +53,7 @@ class PersonalConferencesController < ApplicationController
|
||||||
else
|
else
|
||||||
page_to_show = params[:page_no].to_i
|
page_to_show = params[:page_no].to_i
|
||||||
end
|
end
|
||||||
writing_conferences_show_last = writing_conferences_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count]
|
writing_conferences = writing_conferences_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count]
|
||||||
writing_conferences = writing_conferences_show_last
|
|
||||||
writing_conferences_total_pages = (writing_conferences_show.length/OrbitHelper.page_data_count.to_f).ceil
|
writing_conferences_total_pages = (writing_conferences_show.length/OrbitHelper.page_data_count.to_f).ceil
|
||||||
else
|
else
|
||||||
writing_conferences_total_pages = writing_conferences.total_pages
|
writing_conferences_total_pages = writing_conferences.total_pages
|
||||||
|
|
Loading…
Reference in New Issue