autocomplete: add username autocompletion sitewide.

This commit is contained in:
evazion
2019-08-11 15:38:39 -05:00
parent cab36c307f
commit fa19047220
26 changed files with 45 additions and 46 deletions

View File

@@ -1,3 +1,3 @@
<%= form_tag(users_path, :method => :get) do %>
<%= text_field "search", "name_matches", :id => "quick_search_name_matches", :placeholder => "Search users" %>
<%= text_field "search", "name_matches", :id => "quick_search_name_matches", :placeholder => "Search users", :data => { autocomplete: "user" } %>
<% end %>

View File

@@ -1,9 +1,9 @@
<div id="c-users">
<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.input :name_matches, label: "Name", hint: "Use * for wildcard", input_html: { value: params[:search][:name_matches], data: { autocomplete: "user" } } %>
<%= 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) } %>
<%= sub.input :name_matches, label: "Inviter Name", hint: "Use * for wildcard", input_html: { value: params.dig(:search, :inviter, :name_matches), data: { autocomplete: "user" } } %>
<% end %>
<%= f.input :level, collection: User.level_hash.to_a, include_blank: true, selected: params[:search][:level] %>