move tag search to index (#636)

This commit is contained in:
Toks
2013-04-23 14:58:42 -04:00
parent 48019d684e
commit 730ee0c264
7 changed files with 64 additions and 39 deletions

View File

@@ -39,3 +39,19 @@ table.striped {
background-color: #FAFAFA;
}
}
table.search {
tr {
height: 2em;
}
th {
text-align: right;
padding-right: 1em;
vertical-align: top;
}
td {
vertical-align: top;
}
}

View File

@@ -1,5 +1,5 @@
div#c-tags {
div#a-index {
div#a-index table.striped {
td:nth-child(1), th:nth-child(1) {
width: 5em;
text-align: right;

View File

@@ -0,0 +1,46 @@
<table class="search">
<tbody>
<%= form_tag(tags_path, :method => :get, :class => "simple_form") do %>
<tr>
<th><label for="search_name">Name</label></th>
<td>
<div class="input">
<%= text_field "search", "name_matches" %>
<span class="hint">Use * for wildcard</span>
</div>
</td>
</tr>
<tr>
<th><label for="search_category">Category</label></th>
<td>
<div class="input">
<%= select "search", "category", [""] + Danbooru.config.canonical_tag_category_mapping.to_a %>
</div>
</td>
</tr>
<tr>
<th><label for="search_sort">Sort</label></th>
<td>
<div class="input">
<%= select "search", "sort", %w(count date name) %>
</div>
</td>
</tr>
<tr>
<th><label for="search_hide_empty">Hide Empty</label></th>
<td>
<div class="input">
<%= check_box "search", "hide_empty", {:checked => true}, "yes", "no" %>
</div>
</td>
</tr>
<tr>
<td><%= submit_tag "Search" %><td>
</tr>
<% end %>
</tbody>
</table>

View File

@@ -2,7 +2,6 @@
<menu>
<li><%= render "tags/quick_search" %></li>
<li><%= link_to "Listing", tags_path %></li>
<li><%= link_to "Search", search_tags_path %></li>
<li><%= link_to "Help", wiki_pages_path(:search => {:title => "help:tags"}) %></li>
<% if @tag %>
<li>|</li>

View File

@@ -1,5 +1,6 @@
<div id="c-tags">
<div id="a-index">
<%= render "search" %>
<table class="striped">
<thead>
<tr>

View File

@@ -1,34 +0,0 @@
<div id="c-tags">
<div id="a-search">
<%= form_tag(tags_path, :method => :get, :class => "simple_form") do %>
<div class="input">
<label for="search_name">Name</label>
<%= text_field "search", "name_matches" %>
<span class="hint">Use * for wildcard</span>
</div>
<div class="input">
<label for="search_category">Category</label>
<%= select "search", "category", [""] + Danbooru.config.canonical_tag_category_mapping.to_a %>
</div>
<div class="input">
<label for="search_hide_empty">Hide Empty</label>
<%= select "search", "hide_empty", ["yes", "no"] %>
</div>
<div class="input">
<label for="search_sort">Sort</label>
<%= select "search", "sort", %w(date name count) %>
</div>
<%= submit_tag "Search" %>
<% end %>
</div>
</div>
<%= render "secondary_links" %>
<% content_for(:page_title) do %>
Search Tags - <%= Danbooru.config.app_name %>
<% end %>

View File

@@ -160,9 +160,6 @@ Danbooru::Application.routes.draw do
resource :source, :only => [:show]
resources :tags do
resource :correction, :only => [:new, :create, :show], :controller => "TagCorrections"
collection do
get :search
end
end
resources :tag_aliases do
resource :correction, :only => [:create, :new, :show], :controller => "TagAliasCorrections"