Fix #4930: "Show scores" setting should be preserved

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.
This commit is contained in:
evazion
2021-12-09 15:40:22 -06:00
parent 3de93f556e
commit 7976d12cd0
6 changed files with 47 additions and 33 deletions

View File

@@ -6,8 +6,8 @@
<% if params[:random] %>
<%= hidden_field_tag :random, params[:random] %>
<% end %>
<% if params[:view] %>
<%= hidden_field_tag :view, params[:view] %>
<% if params[:show_votes] %>
<%= hidden_field_tag :show_votes, params[:show_votes] %>
<% end %>
<% if params[:size] %>
<%= hidden_field_tag :size, params[:size] %>