Add search page

- Fix issue with updater_name erroring out
- Add search options is_new and name_changed
This commit is contained in:
BrokenEagle
2020-01-07 01:34:47 +00:00
parent 9182a4f556
commit ad1e22af0b
7 changed files with 61 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
<% content_for(:secondary_links) do %>
<%= quick_search_form_for(:name_matches, pool_versions_path, "pools", autocomplete: "pool") %>
<%= subnav_link_to "Listing", pool_versions_path %>
<%= subnav_link_to "Search", search_pool_versions_path %>
<% end %>

View File

@@ -32,7 +32,7 @@
</div>
</div>
<%= render "pools/secondary_links" %>
<%= render "secondary_links" %>
<% content_for(:page_title) do %>
Pool Version Comparison - <%= @pool_version.name %> - <%= Danbooru.config.app_name %>

View File

@@ -8,4 +8,4 @@
</div>
</div>
<%= render "pools/secondary_links" %>
<%= render "secondary_links" %>

View File

@@ -0,0 +1,19 @@
<div id="c-pool-versions">
<div id="a-search">
<h1>Search Changes</h1>
<%= search_form_for(pool_versions_path) do |f| %>
<%= f.input :updater_name, label: "Updater", input_html: { value: params.dig(:search, :updater_name), "data-autocomplete": "user" } %>
<%= f.input :name_matches, label: "Pool", input_html: { value: params.dig(:search, :name_matches), "data-autocomplete": "pool" } %>
<%= f.input :category, label: "Category", collection: [["Series", "series"], ["Collection", "collection"]], include_blank: true %>
<%= f.input :is_new, label: "New?", collection: [["Yes", true], ["No", false]], include_blank: true %>
<%= f.input :name_changed, label: "Name changed?", collection: [["Yes", true], ["No", false]], include_blank: true %>
<%= f.input :description_changed, label: "Description changed?", collection: [["Yes", true], ["No", false]], include_blank: true %>
<%= f.input :is_active, label: "Active?", collection: [["Yes", true], ["No", false]], include_blank: true %>
<%= f.input :is_banned, label: "Deleted?", collection: [["Yes", true], ["No", false]], include_blank: true %>
<%= f.submit "Search" %>
<% end %>
</div>
</div>
<%= render "secondary_links" %>