summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYar <YarTheGreat@gmail.com>2016-10-26 22:54:03 +0300
committerYar <YarTheGreat@gmail.com>2016-11-01 17:52:16 +0300
commit6893bccd06320c22162037047ab90fc90cfa0246 (patch)
tree55beebfc0ccac3e95da0fd8eaadec74487e56fbf
parentb328c7885532ccff70e1f9f7dc970a8dde0c52d6 (diff)
downloadgitlab-ce-6893bccd06320c22162037047ab90fc90cfa0246.tar.gz
Rename :name search parameter to :search_query at /admin/users
The parameter is used to search users by several criretia was called :name. This request renames it to :search_query which closer to it actual perpose
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/controllers/admin/users_controller.rb2
-rw-r--r--app/views/admin/users/index.html.haml2
3 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 372ddecc98b..26f0a0eb1c1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -40,6 +40,7 @@ Please view this file on the master branch, on stable branches it's out of date.
- Refactor email, use setter method instead AR callbacks for email attribute (Semyon Pupkov)
- Shortened merge request modal to let clipboard button not overlap
- In all filterable drop downs, put input field in focus only after load is complete (Ido @leibo)
+- Improve search query parameter naming in /admin/users !7115 (YarNayar)
## 8.13.2 (2016-10-31)
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index f35f4a8c811..57efa899694 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -3,7 +3,7 @@ class Admin::UsersController < Admin::ApplicationController
def index
@users = User.order_name_asc.filter(params[:filter])
- @users = @users.search(params[:name]) if params[:name].present?
+ @users = @users.search(params[:search_query]) if params[:search_query].present?
@users = @users.sort(@sort = params[:sort])
@users = @users.page(params[:page])
end
diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml
index 357123c2c13..d3038ae644f 100644
--- a/app/views/admin/users/index.html.haml
+++ b/app/views/admin/users/index.html.haml
@@ -10,7 +10,7 @@
= hidden_field_tag "filter", h(params[:filter])
.search-holder
.search-field-holder
- = search_field_tag :name, params[:name], placeholder: 'Search by name, email or username', class: 'form-control search-text-input js-search-input', spellcheck: false
+ = search_field_tag :search_query, params[:search_query], placeholder: 'Search by name, email or username', class: 'form-control search-text-input js-search-input', spellcheck: false
= icon("search", class: "search-icon")
.dropdown
- toggle_text = if @sort.present? then sort_options_hash[@sort] else sort_title_name end