From 730ee0c264ca78472ee450e6e2636e457120723a Mon Sep 17 00:00:00 2001 From: Toks Date: Tue, 23 Apr 2013 14:58:42 -0400 Subject: [PATCH] move tag search to index (#636) --- app/assets/stylesheets/common/tables.css.scss | 16 +++++++ app/assets/stylesheets/specific/tags.css.scss | 2 +- app/views/tags/_search.html.erb | 46 +++++++++++++++++++ app/views/tags/_secondary_links.html.erb | 1 - app/views/tags/index.html.erb | 1 + app/views/tags/search.html.erb | 34 -------------- config/routes.rb | 3 -- 7 files changed, 64 insertions(+), 39 deletions(-) create mode 100644 app/views/tags/_search.html.erb delete mode 100644 app/views/tags/search.html.erb diff --git a/app/assets/stylesheets/common/tables.css.scss b/app/assets/stylesheets/common/tables.css.scss index 3658546ec..5d61d6852 100644 --- a/app/assets/stylesheets/common/tables.css.scss +++ b/app/assets/stylesheets/common/tables.css.scss @@ -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; + } +} diff --git a/app/assets/stylesheets/specific/tags.css.scss b/app/assets/stylesheets/specific/tags.css.scss index db7efa08c..3b7ea1f6b 100644 --- a/app/assets/stylesheets/specific/tags.css.scss +++ b/app/assets/stylesheets/specific/tags.css.scss @@ -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; diff --git a/app/views/tags/_search.html.erb b/app/views/tags/_search.html.erb new file mode 100644 index 000000000..ffb504120 --- /dev/null +++ b/app/views/tags/_search.html.erb @@ -0,0 +1,46 @@ + + + <%= form_tag(tags_path, :method => :get, :class => "simple_form") do %> + + + + + + + + + + + + + + + + + + + + + + + <% end %> + + \ No newline at end of file diff --git a/app/views/tags/_secondary_links.html.erb b/app/views/tags/_secondary_links.html.erb index ea6d62d86..33b6b8e7d 100644 --- a/app/views/tags/_secondary_links.html.erb +++ b/app/views/tags/_secondary_links.html.erb @@ -2,7 +2,6 @@
  • <%= render "tags/quick_search" %>
  • <%= link_to "Listing", tags_path %>
  • -
  • <%= link_to "Search", search_tags_path %>
  • <%= link_to "Help", wiki_pages_path(:search => {:title => "help:tags"}) %>
  • <% if @tag %>
  • |
  • diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index 3b78ca6e1..544b19012 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -1,5 +1,6 @@
    + <%= render "search" %> diff --git a/app/views/tags/search.html.erb b/app/views/tags/search.html.erb deleted file mode 100644 index 9f87e1f48..000000000 --- a/app/views/tags/search.html.erb +++ /dev/null @@ -1,34 +0,0 @@ -
    - -
    - -<%= render "secondary_links" %> - -<% content_for(:page_title) do %> - Search Tags - <%= Danbooru.config.app_name %> -<% end %> diff --git a/config/routes.rb b/config/routes.rb index 49c2d59bb..4e8cd6180 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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"