fixes #3346
This commit is contained in:
@@ -38,6 +38,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
Danbooru.Post.initialize_gestures = function() {
|
Danbooru.Post.initialize_gestures = function() {
|
||||||
|
if (Danbooru.meta("disable-mobile-gestures") === "true") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var $body = $("body");
|
var $body = $("body");
|
||||||
if ($body.data("hammer")) {
|
if ($body.data("hammer")) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -261,6 +261,10 @@ class AnonymousUser
|
|||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def disable_mobile_gestures?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
User::Roles.reject {|r| r == :anonymous}.each do |name|
|
User::Roles.reject {|r| r == :anonymous}.each do |name|
|
||||||
define_method("is_#{name}?") do
|
define_method("is_#{name}?") do
|
||||||
false
|
false
|
||||||
|
|||||||
@@ -25,6 +25,15 @@ class User < ApplicationRecord
|
|||||||
:verified,
|
:verified,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# candidates for removal:
|
||||||
|
# - enable_post_navigation (disabled by 700)
|
||||||
|
# - new_post_navigation_layout (disabled by 1364)
|
||||||
|
# - enable_sequential_post_navigation (disabled by 680)
|
||||||
|
# - hide_deleted_posts (enabled by 1904)
|
||||||
|
# - disable_categorized_saved_searches (enabled by 2291)
|
||||||
|
# - disable_tagged_filenames (enabled by 387)
|
||||||
|
# - enable_recent_searches (enabled by 499)
|
||||||
|
# - disable_cropped_thumbnails (enabled by 22)
|
||||||
BOOLEAN_ATTRIBUTES = %w(
|
BOOLEAN_ATTRIBUTES = %w(
|
||||||
is_banned
|
is_banned
|
||||||
has_mail
|
has_mail
|
||||||
@@ -46,13 +55,14 @@ class User < ApplicationRecord
|
|||||||
disable_tagged_filenames
|
disable_tagged_filenames
|
||||||
enable_recent_searches
|
enable_recent_searches
|
||||||
disable_cropped_thumbnails
|
disable_cropped_thumbnails
|
||||||
|
disable_mobile_gestures
|
||||||
)
|
)
|
||||||
|
|
||||||
include Danbooru::HasBitFlags
|
include Danbooru::HasBitFlags
|
||||||
has_bit_flags BOOLEAN_ATTRIBUTES, :field => "bit_prefs"
|
has_bit_flags BOOLEAN_ATTRIBUTES, :field => "bit_prefs"
|
||||||
|
|
||||||
attr_accessor :password, :old_password
|
attr_accessor :password, :old_password
|
||||||
attr_accessible :dmail_filter_attributes, :enable_privacy_mode, :enable_post_navigation, :new_post_navigation_layout, :password, :old_password, :password_confirmation, :password_hash, :email, :last_logged_in_at, :last_forum_read_at, :has_mail, :receive_email_notifications, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :name, :ip_addr, :time_zone, :default_image_size, :enable_sequential_post_navigation, :per_page, :hide_deleted_posts, :style_usernames, :enable_auto_complete, :custom_style, :show_deleted_children, :disable_categorized_saved_searches, :disable_tagged_filenames, :enable_recent_searches, :disable_cropped_thumbnails, :as => [:moderator, :gold, :platinum, :member, :anonymous, :default, :builder, :admin]
|
attr_accessible :dmail_filter_attributes, :enable_privacy_mode, :enable_post_navigation, :new_post_navigation_layout, :password, :old_password, :password_confirmation, :password_hash, :email, :last_logged_in_at, :last_forum_read_at, :has_mail, :receive_email_notifications, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :name, :ip_addr, :time_zone, :default_image_size, :enable_sequential_post_navigation, :per_page, :hide_deleted_posts, :style_usernames, :enable_auto_complete, :custom_style, :show_deleted_children, :disable_categorized_saved_searches, :disable_tagged_filenames, :enable_recent_searches, :disable_cropped_thumbnails, :disable_mobile_gestures, :as => [:moderator, :gold, :platinum, :member, :anonymous, :default, :builder, :admin]
|
||||||
attr_accessible :level, :as => :admin
|
attr_accessible :level, :as => :admin
|
||||||
|
|
||||||
validates :name, user_name: true, on: :create
|
validates :name, user_name: true, on: :create
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
<meta name="mobile-mode" content="<%= CurrentUser.mobile_mode? %>">
|
<meta name="mobile-mode" content="<%= CurrentUser.mobile_mode? %>">
|
||||||
<meta name="last-forum-read-at" content="<%= CurrentUser.user.last_forum_read_at %>">
|
<meta name="last-forum-read-at" content="<%= CurrentUser.user.last_forum_read_at %>">
|
||||||
<meta name="disable-labeled-saved-searches" content="<%= CurrentUser.disable_categorized_saved_searches? %>">
|
<meta name="disable-labeled-saved-searches" content="<%= CurrentUser.disable_categorized_saved_searches? %>">
|
||||||
|
<%= content_tag(:meta, nil, name: "disable-mobile-gestures", content: CurrentUser.disable_mobile_gestures?) %>
|
||||||
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
|
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
|
||||||
<%= stylesheet_link_tag "application", :media => "screen" %>
|
<%= stylesheet_link_tag "application", :media => "screen" %>
|
||||||
<% if CurrentUser.user.custom_style.present? %>
|
<% if CurrentUser.user.custom_style.present? %>
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
<%= simple_form_for @user do |f| %>
|
<%= simple_form_for @user do |f| %>
|
||||||
<h2 id="edit-options">
|
<h2 id="edit-options">
|
||||||
<%= link_to "Basic settings", "#basic-settings", :class => "active" %>
|
<%= link_to "Basic", "#basic-settings", :class => "active" %>
|
||||||
| <%= link_to "Advanced settings", "#advanced-settings" %>
|
| <%= link_to "Advanced", "#advanced-settings" %>
|
||||||
<% if CurrentUser.user.id == @user.id %>
|
<% if CurrentUser.user.id == @user.id %>
|
||||||
| <%= link_to "Change password", edit_user_password_path(:user_id => @user.id), :id => "change-password" %>
|
| <%= link_to "Change password", edit_user_password_path(:user_id => @user.id), :id => "change-password" %>
|
||||||
| <%= link_to "Delete account", maintenance_user_deletion_path, :id => "delete-account" %>
|
| <%= link_to "Delete account", maintenance_user_deletion_path, :id => "delete-account" %>
|
||||||
@@ -74,6 +74,8 @@
|
|||||||
|
|
||||||
<%= f.input :disable_tagged_filenames, :as => :select, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
|
<%= f.input :disable_tagged_filenames, :as => :select, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
|
||||||
|
|
||||||
|
<%= f.input :disable_mobile_gestures, :as => :select, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
|
||||||
|
|
||||||
<%#= f.input :disable_cropped_thumbnails, :as => :select, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
|
<%#= f.input :disable_cropped_thumbnails, :as => :select, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
|
||||||
|
|
||||||
<div class="input text optional field_with_hint">
|
<div class="input text optional field_with_hint">
|
||||||
|
|||||||
Reference in New Issue
Block a user