diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e18888579..eb0e2f7b4 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -38,9 +38,6 @@ class UsersController < ApplicationController respond_with(@users) end - def search - end - def show @user = authorize User.find(params[:id]) respond_with(@user, methods: @user.full_attributes) do |format| diff --git a/app/views/static/site_map.html.erb b/app/views/static/site_map.html.erb index 893ca7b3b..d6a93fdfe 100644 --- a/app/views/static/site_map.html.erb +++ b/app/views/static/site_map.html.erb @@ -133,7 +133,6 @@ <% end %>
  • <%= link_to_wiki "Help", "help:users" %>
  • <%= link_to("Listing", users_path) %>
  • -
  • <%= link_to("Search", search_users_path) %>
  • <%= link_to("Bans", bans_path) %>
  • <%= link_to("Feedback", user_feedbacks_path) %>
  • <%= link_to("Terms of Service", terms_of_service_path) %>
  • diff --git a/app/views/users/_secondary_links.html.erb b/app/views/users/_secondary_links.html.erb index e1b885966..4487865cd 100644 --- a/app/views/users/_secondary_links.html.erb +++ b/app/views/users/_secondary_links.html.erb @@ -1,7 +1,6 @@ <% content_for(:secondary_links) do %> <%= quick_search_form_for(:name_matches, users_path, "users", autocomplete: "user", redirect: true) %> <%= subnav_link_to "Listing", users_path %> - <%= subnav_link_to "Search", search_users_path %> <% if CurrentUser.user.is_anonymous? %> <%= subnav_link_to "Sign up", new_user_path %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 2c3bae957..beb6c91e8 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -2,6 +2,15 @@

    Users

    + <%= search_form_for(users_path) do |f| %> + <%= f.input :name_matches, label: "Name", hint: "Use * for wildcard", input_html: { value: params[:search][:name_matches], data: { autocomplete: "user" } } %> + <%= f.input :level, collection: User.level_hash.to_a, include_blank: true, selected: params[:search][:level] %> + <%= f.input :can_upload_free, label: "Contributor?", as: :select, include_blank: true, selected: params[:search][:can_upload_free] %> + <%= f.input :can_approve_posts, label: "Approver?", as: :select, include_blank: true, selected: params[:search][:can_approve_posts] %> + <%= f.input :order, collection: [["Joined", "date"], ["Name", "name"], ["Posts", "post_upload_count"], ["Edits", "post_update_count"], ["Notes", "note_count"]], include_blank: true, selected: params[:search][:order] %> + <%= f.submit "Search" %> + <% end %> + <%= table_for @users, width: "100%" do |t| %> <% t.column column: "control" do |user| %> <% if policy(CurrentUser.user).promote? %> diff --git a/app/views/users/search.html.erb b/app/views/users/search.html.erb deleted file mode 100644 index c41962a0b..000000000 --- a/app/views/users/search.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -
    - -
    - -<%= render "secondary_links" %> diff --git a/config/routes.rb b/config/routes.rb index 13675fad2..d17321a92 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -243,7 +243,6 @@ Rails.application.routes.draw do end collection do - get :search get :custom_style end end