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:
@@ -1,72 +1,10 @@
|
||||
<table class="search">
|
||||
<tbody>
|
||||
<%= form_tag path, :method => :get, :class => "simple_form" do %>
|
||||
<tr>
|
||||
<th><label for="search_name_matches">Name</label></th>
|
||||
<td>
|
||||
<div class="input">
|
||||
<%= text_field "search", "name_matches", :value => params[:search][:name_matches], :data => { autocomplete: "pool" } %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><label for="search_description_matches">Description</label></th>
|
||||
<td>
|
||||
<div class="input">
|
||||
<%= text_field "search", "description_matches", :value => params[:search][:description_matches] %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><label for="search_post_tags">Post Tags</th>
|
||||
<td>
|
||||
<div class="input">
|
||||
<%= text_field "search", "post_tags_match", :value => params[:search][:post_tags_match], :data => { autocomplete: "tag-query" } %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><label for="search_creator_name">Creator</th>
|
||||
<td>
|
||||
<div class="input">
|
||||
<%= text_field "search", "creator_name", :value => params[:search][:creator_name], :data => { autocomplete: "pool" } %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><label for="search_is_active">Status</th>
|
||||
<td>
|
||||
<div class="input">
|
||||
<%= select "search", "is_active", ["", ["Active", "true"], ["Inactive", "false"]], :selected => params[:search][:is_active] %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><label for="search_category">Category</th>
|
||||
<td>
|
||||
<div class="input">
|
||||
<%= select "search", "category", [["Series", "series"], ["Collection", "collection"]], :selected => params[:search][:category], :include_blank => true %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><label for="search_order">Order</th>
|
||||
<td>
|
||||
<div class="input">
|
||||
<%= select "search", "order", [["Last updated", "updated_at"], ["Name", "name"], ["Recently created", "created_at"], ["Post count", "post_count"]], :selected => params[:search][:order], :include_blank => true %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><%= submit_tag "Search" %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= search_form_for(path) do |f| %>
|
||||
<%= f.input :name_matches, label: "Name", input_html: { value: params.dig(:search, :name_matches), "data-autocomplete": "pool" } %>
|
||||
<%= f.input :description_matches, label: "Description", input_html: { value: params.dig(:search, :description_matches) } %>
|
||||
<%= f.input :post_tags_match, label: "Post tags", input_html: { value: params.dig(:search, :post_tags_match), "data-autocomplete": "tag-query" } %>
|
||||
<%= f.input :creator_name, label: "Creator", input_html: { value: params.dig(:search, :creator_name), "data-autocomplete": "user" } %>
|
||||
<%= f.input :is_active, label: "Status", as: :select, collection: [%w[Active true], %w[Inactive false]], include_blank: true, selected: params.dig(:search, :is_active) %>
|
||||
<%= f.input :category, collection: %w[series collection], include_blank: true, selected: params[:search][:category] %>
|
||||
<%= f.input :order, collection: [%w[Last\ updated updated_at], %w[Name name], %w[Recently\ created created_at], %w[Post\ count post_count]], include_blank: true, selected: params.dig(:search, :order) %>
|
||||
<%= f.submit "Search" %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user