Make "show scores" setting persistent. The setting is stored in a `post_preview_show_votes` cookie. This means it's remembered on a per-device basis, but not on a per-account basis. This is so users without an account can use the setting, and so you can use different settings on desktop and mobile. The `view=score` URL param has been replaced by `show_votes=true`. The `show_votes` URL param overrides the `post_preview_show_votes` cookie.
19 lines
688 B
Plaintext
19 lines
688 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[:show_votes] %>
|
|
<%= hidden_field_tag :show_votes, params[:show_votes] %>
|
|
<% 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>
|