move tag search to index (#636)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
46
app/views/tags/_search.html.erb
Normal file
46
app/views/tags/_search.html.erb
Normal 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>
|
||||
@@ -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>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<div id="c-tags">
|
||||
<div id="a-index">
|
||||
<%= render "search" %>
|
||||
<table class="striped">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -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 %>
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user