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,7 +1,7 @@
<%= simple_form_for(ban) do |f| %>
<%= error_messages_for("ban") %>
<%= f.input :user_name, :as => :string %>
<%= f.input :user_name, :as => :string, :input_html => { data: { autocomplete: "user" } } %>
<%= f.input :duration, :hint => "in days" %>
<%= f.input :reason %>
<%= f.button :submit, :value => "Ban" %>

View File

@@ -1,6 +1,6 @@
<%= simple_form_for(:search, method: :get, url: bans_path, defaults: { required: false }, html: { class: "inline-form" }) do |f| %>
<%= f.input :user_name, label: "User", input_html: { value: params[:search][:user_name] } %>
<%= f.input :banner_name, label: "Banner", input_html: { value: params[:search][:banner_name] } %>
<%= f.input :user_name, label: "User", input_html: { value: params[:search][:user_name], data: { autocomplete: "user" } } %>
<%= f.input :banner_name, label: "Banner", input_html: { value: params[:search][:banner_name], data: { autocomplete: "user" } } %>
<%= f.input :reason_matches, label: "Reason", hint: "Use * for wildcard", input_html: { value: params[:search][:reason_matches] } %>
<%= f.input :expired, label: "Expired?", collection: [["Yes", true], ["No", false]], include_blank: true, selected: params[:search][:expired] %>
<%= f.input :order, include_blank: false, collection: [%w[Created id_desc], %w[Expiration expires_at_desc]], selected: params[:search][:order] %>