diff --git a/app/controllers/admin/writing_conferences_controller.rb b/app/controllers/admin/writing_conferences_controller.rb index c3876a0..b6564fa 100644 --- a/app/controllers/admin/writing_conferences_controller.rb +++ b/app/controllers/admin/writing_conferences_controller.rb @@ -5,7 +5,7 @@ class Admin::WritingConferencesController < OrbitMemberController before_action :get_settings,:only => [:new, :edit, :setting] def index - @writing_conferences = WritingConference.all + @writing_conferences = WritingConference.order_by(:year=>'desc').page(params[:page]).per(10) end def new diff --git a/app/controllers/personal_conferences_controller.rb b/app/controllers/personal_conferences_controller.rb index 7471ceb..13c51e7 100644 --- a/app/controllers/personal_conferences_controller.rb +++ b/app/controllers/personal_conferences_controller.rb @@ -1,6 +1,6 @@ class PersonalConferencesController < ApplicationController def index - writing_conferences = WritingConference.where(:is_hidden=>false).all + writing_conferences = WritingConference.where(:is_hidden=>false).order_by(:year=>'desc').page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) writing_conference_list = writing_conferences.collect do |writing_conference| { "year" => writing_conference.year, @@ -16,7 +16,8 @@ class PersonalConferencesController < ApplicationController "th_year" => t('personal_plugins.year'), "th_title" => t("personal_conference.paper_title"), "th_author" => t('personal_plugins.author') - } + }, + "total_pages" => writing_conferences.total_pages } end @@ -58,7 +59,7 @@ class PersonalConferencesController < ApplicationController "location" => writing_conference.location, "sponsor" => writing_conference.sponsor, "year" => writing_conference.year, - "language" => t(writing_conference.language), + "language" => (t(writing_conference.language) rescue ""), "keywords" => writing_conference.keywords, "abstract" => writing_conference.abstract, "publication_date" => writing_conference.publication_date, diff --git a/app/views/admin/writing_conferences/index.html.erb b/app/views/admin/writing_conferences/index.html.erb index 23a92ab..79f9a35 100644 --- a/app/views/admin/writing_conferences/index.html.erb +++ b/app/views/admin/writing_conferences/index.html.erb @@ -7,15 +7,15 @@
- <%= render :partial => 'writing_conference', :collection => @writing_conferences %> + <%= render 'writing_conference' %>