diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 86e6ad8ad3a..6316fa0cf30 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -63,6 +63,7 @@ def set_anonymized_view def list letter = params[:letter] search_by = params[:search_by] + @pagination_options = pagination_options # If search parameters present if letter.present? && search_by.present? case search_by.to_i @@ -259,7 +260,6 @@ def pagination_options # For filtering the users list with proper search and pagination. def paginate_list paginate_options = pagination_options - # If the above hash does not have a value for the key, # it means that we need to show all the users on the page # diff --git a/app/views/users/list.html.erb b/app/views/users/list.html.erb index 472b1ea21b6..d89a94d5f74 100644 --- a/app/views/users/list.html.erb +++ b/app/views/users/list.html.erb @@ -1,19 +1,20 @@

Manage users


-<%= form_tag :action => 'list', method: :get, id: 'pagination_form' do %> - <%= label_tag :letter, 'Search users: ' %><%= text_field_tag(:letter, params[:letter]) %> +<%= form_tag :action => 'show_if_authorized' do %> + View user - enter exact login: <%= text_field_with_auto_complete :user, :username, {:size => 41} %> + +<% end %> + +<%= form_tag :action => 'list' do %> + <%= label_tag :letter, 'Search users: ' %> + <%= text_field_tag(:letter, params[:letter]) %> <%= select_tag(:search_by, options_for_select([['Username', 1], ['Full name', 2], ['Email', 3]])) %> <%= submit_tag("Search") %> -

- - <%= select_tag(:per_page, options_for_select( - [['25 users', '1'], ['50 users', '2'], ['100 users', '3'], ['All users', '4']], - selected: @per_page - ), - onchange: "document.getElementById('pagination_form').submit();" - ) %> + <%= label_tag :per_page, 'Users per page: ' %> + <%= select_tag(:per_page, options_for_select(@pagination_options, selected: params[:per_page] || '3')) %> + <%= submit_tag("Apply", name: nil) %> <% end %>