From 2db3af56dddcea5780ffb4bcab83cdd30d983c0c Mon Sep 17 00:00:00 2001 From: evazion Date: Fri, 21 Apr 2017 21:01:37 -0500 Subject: [PATCH] /tags: convert search form to simple form. --- app/views/tags/_search.html.erb | 73 ++++----------------------------- 1 file changed, 9 insertions(+), 64 deletions(-) diff --git a/app/views/tags/_search.html.erb b/app/views/tags/_search.html.erb index 1fc0ae8c0..0686a75a5 100644 --- a/app/views/tags/_search.html.erb +++ b/app/views/tags/_search.html.erb @@ -1,64 +1,9 @@ - - - <%= form_tag(tags_path, :method => :get, :class => "simple_form") do %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <% end %> - - +<%= simple_form_for(:search, url: tags_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 :category, label: "Category", collection: Danbooru.config.canonical_tag_category_mapping.to_a, include_blank: true,selected: params[:search][:category] %> + <%= f.input :order, collection: [%w[Newest date], %w[Count count], %w[Name name]], include_blank: false, selected: params[:search][:order] %> + <%= f.input :hide_empty, label: "Hide empty?", collection: %w[yes no], selected: params[:search][:hide_empty] %> + <%= f.input :has_wiki, label: "Has wiki?", collection: %w[yes no], include_blank: true, selected: params[:search][:has_wiki] %> + <%= f.input :has_artist, label: "Has artist?", collection: %w[yes no], include_blank: true, selected: params[:search][:has_artist] %> + <%= f.submit "Search" %> +<% end %>