Fix #3941: Add ability to search users by inviter.

This commit is contained in:
evazion
2018-10-02 19:38:55 -05:00
parent abbe181de6
commit 0966a290e4
4 changed files with 15 additions and 17 deletions

View File

@@ -2,6 +2,9 @@
<div id="a-search">
<%= simple_form_for(:search, url: users_path, method: :get, defaults: { required: false }, html: { class: "inline-form" }) do |f| %>
<%= f.input :name_matches, label: "Name", hint: "Use * for wildcard", input_html: { value: params[:search][:name_matches] } %>
<%= f.simple_fields_for :inviter do |sub| %>
<%= sub.input :name_matches, label: "Inviter Name", hint: "Use * for wildcard", input_html: { value: params.dig(:search, :inviter, :name_matches) } %>
<% end %>
<%= f.input :level, collection: User.level_hash.to_a, include_blank: true, selected: params[:search][:level] %>
<%= f.input :min_level, collection: User.level_hash.to_a, include_blank: true, selected: params[:search][:min_level] %>