move save search button to sidebar

This commit is contained in:
r888888888
2017-11-17 16:49:53 -08:00
parent f180e1bbe2
commit c0ddf266fc
7 changed files with 13 additions and 84 deletions

View File

@@ -38,7 +38,7 @@ div#page {
}
input[type=text] {
width: 8em;
width: 10em;
z-index: 1000;
position: relative;
}

View File

@@ -1,69 +0,0 @@
@import "common/010_reset.scss";
@import "common/020_base.scss";
@import "common/030_links.scss";
body {
padding: 5px;
}
input[type=text], input[type=submit] {
font-size: 18pt;
}
/* paginator */
div.paginator {
font-size: 16pt;
font-weight: bold;
text-align: center;
li {
display: inline;
a, span {
padding: 3px 18px;
margin: 0 3px;
display: inline-block;
}
}
}
/* posts/index */
article.post-preview {
margin: 15px 0;
width: 150px;
text-align: center;
vertical-align: middle;
display: inline-block;
a {
width: 150px;
display: block;
margin: 0 auto;
}
img {
margin: 0 auto;
}
}
/* posts/show */
img#image {
margin-top: 5px;
}
div#options {
margin-top: 10px;
font-size: 24pt;
font-weight: bold;
}
div#tags {
margin-top: 30px;
li {
margin: 10px 0;
}
a.search-tag {
font-size: 24pt;
font-weight: bold;
}
}

View File

@@ -90,6 +90,7 @@ class ApplicationController < ActionController::Base
flash[:notice] = "This feature isn't available: #{@exception.message}"
respond_to do |fmt|
fmt.html { redirect_to :back }
fmt.js { render nothing: true, status: 501 }
fmt.json { render template: "static/error", status: 501 }
fmt.xml { render template: "static/error", status: 501 }
end

View File

@@ -22,7 +22,7 @@ class SavedSearchesController < ApplicationController
end
def create
@saved_search = saved_searches.create(:query => params[:saved_search_tags], :label_string => params[:saved_search_labels])
@saved_search = saved_searches.create!(:query => params[:saved_search_tags], :label_string => params[:saved_search_labels])
if params[:saved_search_disable_labels]
CurrentUser.disable_categorized_saved_searches = true
CurrentUser.save

View File

@@ -7,13 +7,13 @@
<%= render "posts/partials/index/blacklist" %>
<%#= raw common_searches_html(CurrentUser.user) %>
<section id="tag-box">
<h1>Tags</h1>
<%= @post_set.presenter.tag_list_html(self) %>
</section>
<%= render "posts/partials/index/options" %>
<%= render "posts/partials/index/related" %>
</aside>

View File

@@ -15,17 +15,6 @@
<% end %>
<%= hidden_field_tag "ms", "1" %>
<%= submit_tag "Go", :name => nil, :class => "ui-button ui-widget ui-corner-all tiny gradient" %>
<%= submit_tag "+", :id => "expand-search", "data-jq-dropdown" => "#search-dropdown", :class => "ui-button ui-widget ui-corner-all tiny gradient" %>
<div id="search-dropdown" class="jq-dropdown jq-dropdown-tip">
<ul class="jq-dropdown-menu">
<% if SavedSearch.enabled? && CurrentUser.show_saved_searches? %>
<li><%= link_to "Save search", saved_searches_path, :id => "save-search" %></li>
<% end %>
<li><%= link_to "Search wiki", wiki_pages_path, :id => "wiki-search" %></li>
<li><%= link_to "Search artists", artists_path, :id => "artist-search" %></li>
</ul>
</div>
<% end %>
</section>

View File

@@ -0,0 +1,8 @@
<section id="options-box">
<h1>Options</h1>
<ul>
<% if SavedSearch.enabled? && CurrentUser.is_member? %>
<li><%= button_tag "Save search", id: "save-search", class: "ui-button ui-widget ui-corner-all gradient sub" %></li>
<% end %>
</ul>
</section>