move desktop mode to user pref

This commit is contained in:
r888888888
2017-12-15 13:52:25 -08:00
parent 4dabbde05d
commit a95af95eae
8 changed files with 25 additions and 34 deletions

View File

@@ -5,7 +5,7 @@
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="top" title="<%= Danbooru.config.app_name %>" href="/">
<%= csrf_meta_tag %>
<% unless cookies[:dm] %>
<% unless CurrentUser.disable_responsive_mode? %>
<meta name="viewport" content="width=device-width,initial-scale=1">
<% end %>
<meta name="tag-category-names" content="<%= TagCategory.categories %>">

View File

@@ -8,8 +8,10 @@
<% if CurrentUser.user.enable_post_navigation %>
&ndash; <%= link_to "Keyboard shortcuts available", keyboard_shortcuts_path %>
<% end %>
<span id="desktop-version-link">
&ndash;
<%= link_to "Desktop version", site_map_path(:dm => "1"), :rel => "nofollow" %>
</span>
<% if CurrentUser.is_member? %>
<span id="desktop-version-link">
&ndash;
<%= link_to "Disable responsive mode", edit_user_path(CurrentUser.id), :rel => "nofollow" %>
</span>
<% end %>
</footer>

View File

@@ -91,11 +91,7 @@
<%= f.input :favorite_tags, :label => "Frequent tags", :hint => "A list of tags that you use often. They will appear when using the list of Related Tags.", :input_html => { :rows => 5, :data => { :autocomplete => "tag-query" } } %>
<div class="input select field_with_hint">
<label class="select optional" for="user_desktop_mode">Desktop mode</label>
<%= select_tag "user[desktop_mode]", options_for_select([["No", "0"], ["Yes", "1"]], cookies[:dm]), :class => "select optional" %>
<span class="hint">Force desktop version of site even on mobile.</span>
</div>
<%= f.input :disable_responsive_mode, :as => :select, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false, :hint => "Disable alternative layout for mobile and tablet" %>
<%= f.input :custom_style, :label => "Custom <a href='http://en.wikipedia.org/wiki/Cascading_Style_Sheets'>CSS</a> style".html_safe, :hint => "Style to apply to the whole site.", :input_html => {:size => "40x5"} %>
</fieldset>