views: migrate search forms to use simple form.

Migrate various forms to be built using simple form instead of raw html.
Also adds autocomplete="off" to these forms (#4162).
This commit is contained in:
evazion
2019-09-10 14:29:07 -05:00
parent 1743f3797f
commit a1b48f5e3f
13 changed files with 68 additions and 177 deletions

View File

@@ -1,27 +1,14 @@
<div id="c-wiki-pages">
<div id="a-search">
<%= form_tag(wiki_pages_path, :method => :get, :class => "simple_form") do %>
<%= search_field "title", :hint => "Use * for wildcard searches", :data => { :autocomplete => "wiki-page" } %>
<%= search_field "creator_name", :data => { :autocomplete => "user" } %>
<%= search_field "body_matches", :label => "Body" %>
<%= search_field "other_names_match", :label => "Other names", :hint => "Use * for wildcard searches" %>
<div class="input">
<label for="search_other_names_present">Other names present?</label>
<%= select "search", "other_names_present", ["yes", "no"], :include_blank => true %>
</div>
<div class="input">
<label for="search_order">Order</label>
<%= select "search", "order", [%w[Name title], %w[Date time], %w[Posts post_count]] %>
</div>
<div class="input">
<label for="search_hide_deleted">Hide Deleted</label>
<%= select "search", "hide_deleted", ["Yes", "No"] %>
</div>
<%= submit_tag "Search" %>
<%= search_form_for(wiki_pages_path) do |f| %>
<%= f.input :title, hint: "Use * for wildcard searches", input_html: { "data-autocomplete": "wiki-page" } %>
<%= f.input :other_names_match, label: "Other names", hint: "Use * for wildcard searches" %>
<%= f.input :creator_name, input_html: { "data-autocomplete": "user" } %>
<%= f.input :body_matches, label: "Body" %>
<%= f.input :other_names_present, as: :select %>
<%= f.input :hide_deleted, as: :select, include_blank: false %>
<%= f.input :order, collection: [%w[Name title], %w[Date time], %w[Posts post_count]], include_blank: false %>
<%= f.submit "Search" %>
<% end %>
</div>
</div>