组织列表增加分页功能,学校列表调整分页
This commit is contained in:
parent
f8a88767c0
commit
66a7827eb2
|
@ -392,6 +392,11 @@ class AdminController < ApplicationController
|
|||
def organization
|
||||
@organizations = Organization.find_by_sql("SELECT * FROM organizations ORDER BY created_at DESC")
|
||||
#@organizations = Organization.all.order("created_at desc")
|
||||
@organization_count = @organizations.count
|
||||
@organization_pages = Paginator.new @organization_count, 30, params['page'] || 1
|
||||
@organizations = paginateHelper @organizations,30
|
||||
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
|
@ -403,8 +408,8 @@ class AdminController < ApplicationController
|
|||
@schools = School.find_by_sql("SELECT * FROM schools ORDER BY created_at DESC")
|
||||
@school_count = @schools.count
|
||||
|
||||
@school_pages = Paginator.new @school_count, 50, params['page'] || 1
|
||||
@schools = paginateHelper @schools,50
|
||||
@school_pages = Paginator.new @school_count, 30, params['page'] || 1
|
||||
@schools = paginateHelper @schools,30
|
||||
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
respond_to do |format|
|
||||
|
|
|
@ -40,4 +40,8 @@
|
|||
</table>
|
||||
</div>
|
||||
|
||||
<ul class="wlist" id="pages" style="float: right;margin-top: 10px;">
|
||||
<%= pagination_links_full @organization_pages, @organization_count ,:per_page_links => true, :remote => false, :flag => true %>
|
||||
</ul>
|
||||
|
||||
<!% html_title(l(:llabel_organization_list)) -%>
|
||||
|
|
Loading…
Reference in New Issue