summaryrefslogtreecommitdiffstats
path: root/app/helpers/groups_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-18 17:57:16 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-18 17:57:16 +0000
commit1257f1960ff6d59b2f3f7890777d3481f1800430 (patch)
tree6be67b6fc92cb8a408ed002fc6fe219ea566bb9a /app/helpers/groups_helper.rb
parent10c96dba8b79822e1d54ef58bb8139851cf30c80 (diff)
downloadredmine-1257f1960ff6d59b2f3f7890777d3481f1800430.tar.gz
redmine-1257f1960ff6d59b2f3f7890777d3481f1800430.zip
Adds pagination to users list when adding project or group members (#9549).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11200 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/groups_helper.rb')
-rw-r--r--app/helpers/groups_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb
index 91cbb803f..5e6b1f7aa 100644
--- a/app/helpers/groups_helper.rb
+++ b/app/helpers/groups_helper.rb
@@ -24,4 +24,19 @@ module GroupsHelper
{:name => 'memberships', :partial => 'groups/memberships', :label => :label_project_plural}
]
end
+
+ def render_principals_for_new_group_users(group)
+ scope = User.active.not_in_group(group).like(params[:q])
+ principal_count = scope.count
+ principal_pages = Redmine::Pagination::Paginator.new principal_count, 100, params['page']
+ principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).all
+
+ s = content_tag('div', principals_check_box_tags('user_ids[]', principals), :id => 'principals')
+
+ links = pagination_links_full(principal_pages, principal_count, :per_page_links => false) {|text, parameters, options|
+ link_to text, autocomplete_for_user_group_path(group, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
+ }
+
+ s + content_tag('p', links, :class => 'pagination')
+ end
end