mirror of
https://github.com/redmine/redmine.git
synced 2025-11-07 22:05:56 +01:00
Adds pagination to group list.
git-svn-id: http://svn.redmine.org/redmine/trunk@15756 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -30,7 +30,12 @@ class GroupsController < ApplicationController
|
|||||||
def index
|
def index
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
@groups = Group.sorted.to_a
|
scope = Group.sorted
|
||||||
|
scope = scope.like(params[:name]) if params[:name].present?
|
||||||
|
|
||||||
|
@group_count = scope.count
|
||||||
|
@group_pages = Paginator.new @group_count, per_page_option, params['page']
|
||||||
|
@groups = scope.limit(@group_pages.per_page).offset(@group_pages.offset).to_a
|
||||||
@user_count_by_group_id = user_count_by_group_id
|
@user_count_by_group_id = user_count_by_group_id
|
||||||
}
|
}
|
||||||
format.api {
|
format.api {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
<%= title l(:label_group_plural) %>
|
<%= title l(:label_group_plural) %>
|
||||||
<% if @groups.any? %>
|
<% if @groups.any? %>
|
||||||
|
<div class="autoscroll">
|
||||||
<table class="list groups">
|
<table class="list groups">
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
<th><%=l(:label_group)%></th>
|
<th><%=l(:label_group)%></th>
|
||||||
@@ -20,6 +21,8 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
<span class="pagination"><%= pagination_links_full @group_pages, @group_count %></span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user