Files
danbooru/app/views/posts/partials/common/_search.html.erb
evazion 3de93f556e posts: make thumbnail size setting persistent.
Make setting the thumbnail size persistent.

The setting is stored in a `post_preview_size` cookie. This cookie can
be overridden by the `size` URL param, like so:

  https://danbooru.donmai.us/posts?tags=touhou&size=180

The `size` param is mainly for testing different sizes without setting a cookie.
2021-12-09 15:46:08 -06:00

19 lines
670 B
Plaintext

<%# path, tags %>
<section id="search-box">
<h2>Search</h2>
<%= form_tag(path, method: "get", id: "search-box-form", class: "flex") do %>
<% if params[:random] %>
<%= hidden_field_tag :random, params[:random] %>
<% end %>
<% if params[:view] %>
<%= hidden_field_tag :view, params[:view] %>
<% end %>
<% if params[:size] %>
<%= hidden_field_tag :size, params[:size] %>
<% end %>
<%= text_field_tag("tags", tags, :id => tags_dom_id, :class => "flex-auto", :"data-shortcut" => "q", :"data-autocomplete" => "tag-query") %>
<button id="search-box-submit" type="submit"><%= search_icon %></button>
<% end %>
</section>