add index paginates

This commit is contained in:
Chihyu 2020-04-06 15:40:47 +08:00
parent 6137eeb8b6
commit b845b3c835
4 changed files with 11 additions and 8 deletions

View File

@ -10,15 +10,18 @@ class Admin::ActivitiesController < OrbitMemberController
def index def index
@activities = Activity.order_by(:year => 'desc').page(params[:page]).per(10) @activities = Activity.order_by(:year => 'desc').page(params[:page]).per(10)
respond_to do |format| #respond_to do |format|
format.html #format.html
format.xml { render :xml => @activities } #format.xml { render :xml => @activities }
end #end
end end
def new def new
@member = MemberProfile.find_by(:uid=>params['uid']) rescue nil @member = MemberProfile.find_by(:uid=>params['uid']) rescue nil
@activity = Activity.new @activity = Activity.new
if params[:desktop]
render :layout => false
end
end end
def create def create

View File

@ -34,7 +34,8 @@ class PersonalActivitiesController < ApplicationController
'activity_end_date' => t('personal_activity.activity_end_date'), 'activity_end_date' => t('personal_activity.activity_end_date'),
'year' => t('personal_activity.year'), 'year' => t('personal_activity.year'),
'note' => t('personal_activity.note') 'note' => t('personal_activity.note')
} },
"total_pages" => activities.total_pages
} }
end end

View File

@ -45,8 +45,7 @@ class Activity
"activity_organizer", "activity_organizer",
"activity_area", "activity_area",
"activity_start_date", "activity_start_date",
"activity_end_date", "activity_end_date"
"year"
] ]
fields_to_remove = [] fields_to_remove = []

View File

@ -14,7 +14,7 @@ module PersonalActivity
update_info 'some update_info' update_info 'some update_info'
frontend_enabled frontend_enabled
data_count 1..10 data_count 1..30
icon_class_no_sidebar "icons-user" icon_class_no_sidebar "icons-user"
end end
end end