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
@activities = Activity.order_by(:year => 'desc').page(params[:page]).per(10)
respond_to do |format|
format.html
format.xml { render :xml => @activities }
end
#respond_to do |format|
#format.html
#format.xml { render :xml => @activities }
#end
end
def new
@member = MemberProfile.find_by(:uid=>params['uid']) rescue nil
@activity = Activity.new
if params[:desktop]
render :layout => false
end
end
def create

View File

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

View File

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

View File

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