Merge pull request #3002 from evazion/feat-artist-search

Fix #2994: More options for artist search page
This commit is contained in:
Albert Yi
2017-04-26 14:00:25 -07:00
committed by GitHub
3 changed files with 55 additions and 29 deletions

View File

@@ -1,28 +1,10 @@
<table class="search">
<tbody>
<%= form_tag(artists_path, :method => :get, :class => "simple_form") do %>
<tr>
<th><label for="search_name">Name</label>
<td>
<div class="input">
<%= text_field "search", "name", :value => params[:search][:name] %>
<span class="hint">You can search on any name or URL</span>
</div>
</td>
</tr>
<tr>
<th><label for="search_order">Order</label>
<td>
<div class="input">
<%= select "search", "order", [["Recently created", "created_at"], ["Last updated", "updated_at"], ["Name", "name"], ["Post count", "post_count"]], :selected => params[:search][:order] %>
</div>
</td>
</tr>
<tr>
<td><%= submit_tag "Search" %></td>
</tr>
<% end %>
</tbody>
</table>
<%= simple_form_for(:search, url: artists_path, method: :get, defaults: { required: false }, html: { class: "inline-form" }) do |f| %>
<%= f.input :name, label: "Name", hint: "Use * for wildcard", input_html: { value: params[:search][:name] } %>
<%= f.input :url_matches, label: "URL", as: "string", input_html: { value: params[:search][:url_matches] } %>
<%= f.input :creator_name, label: "Creator", input_html: { value: params[:search][:creator_name] } %>
<%= f.input :is_active, label: "Active?", collection: [["Yes", true], ["No", false]], include_blank: true, selected: params[:search][:is_active] %>
<%= f.input :is_banned, label: "Banned?", collection: [["Yes", true], ["No", false]], include_blank: true, selected: params[:search][:is_banned] %>
<%= f.input :has_tag, label: "Has tag?", collection: [["Yes", true], ["No", false]], include_blank: true, selected: params[:search][:has_tag] %>
<%= f.input :order, collection: [["Recently created", "created_at"], ["Last updated", "updated_at"], ["Name", "name"], ["Post count", "post_count"]], selected: params[:search][:order] %>
<%= f.submit "Search" %>
<% end %>