From b6fef7f3f3967188a7c68b7b826f97199e815699 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 14 Jan 2021 15:00:43 -0600 Subject: [PATCH] users: remove option to disable search navbar. Remove the enable_sequential_post_navigation option. This option was used to disable the next/previous post navbar below posts. This option was originally added in issue #674 because of people complaining about the navbar when it was originally added. Also there were complaints about URLs being uglier because of search params in the URL (e.g. /posts/1234?q=touhou). There were also various minor bugs with it at the time, such as keyboard shortcuts not working correctly, or the page not remembering your search after a tag edit. These complaints are irrelevant nowadays because a) people are used to the navbar by now (and more often complain about it *not* being there for order:score searches), b) post URLs always contain the search now, this option hasn't disabled that for years, and c) the initial bugs with it were fixed years ago. Only ~1000 users disabled this option and only ~600 were seen in the last year. Users still wishing to hide the search navbar can use custom CSS instead. --- CHANGELOG.md | 2 ++ app/models/user.rb | 1 - app/policies/user_policy.rb | 11 +++++------ app/presenters/post_presenter.rb | 2 +- app/views/users/edit.html.erb | 1 - 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a933c1d1..33c9d3355 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ the navbar beneath posts that lets you move to the next or previous post in a tag search. Previously this was only available to logged-in users. +* Removed the option to disable the next/previous post navbar. + ## 2021-01-12 ### Changes diff --git a/app/models/user.rb b/app/models/user.rb index d4044c6c6..152f55558 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -671,7 +671,6 @@ class User < ApplicationRecord def initialize_attributes self.enable_post_navigation = true self.new_post_navigation_layout = true - self.enable_sequential_post_navigation = true self.enable_auto_complete = true self.always_resize_images = true end diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb index 58d6b654e..e21352bce 100644 --- a/app/policies/user_policy.rb +++ b/app/policies/user_policy.rb @@ -45,12 +45,11 @@ class UserPolicy < ApplicationPolicy :blacklisted_tags, :time_zone, :per_page, :custom_style, :theme, :receive_email_notifications, :always_resize_images, :enable_post_navigation, :new_post_navigation_layout, - :enable_private_favorites, :enable_sequential_post_navigation, - :hide_deleted_posts, :style_usernames, :enable_auto_complete, - :show_deleted_children, :disable_categorized_saved_searches, - :disable_tagged_filenames, :disable_cropped_thumbnails, - :disable_mobile_gestures, :enable_safe_mode, :enable_desktop_mode, - :disable_post_tooltips, + :enable_private_favorites, :hide_deleted_posts, :style_usernames, + :enable_auto_complete, :show_deleted_children, + :disable_categorized_saved_searches, :disable_tagged_filenames, + :disable_cropped_thumbnails, :disable_mobile_gestures, :enable_safe_mode, + :enable_desktop_mode, :disable_post_tooltips, ].compact end diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb index 23fee57c1..9c098859e 100644 --- a/app/presenters/post_presenter.rb +++ b/app/presenters/post_presenter.rb @@ -25,6 +25,6 @@ class PostPresenter def has_sequential_navigation?(params) return false if PostQueryBuilder.new(params[:q]).has_metatag?(:order, :ordfav, :ordpool) return false if params[:pool_id].present? || params[:favgroup_id].present? - return CurrentUser.user.enable_sequential_post_navigation + true end end diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 798ae62c7..572d9985d 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -60,7 +60,6 @@ <%= f.input :style_usernames, :as => :select, :label => "Colored usernames", :hint => "Color users according to their user level", :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %> <%= f.input :enable_post_navigation, :as => :select, :include_blank => false, :label => "Enable keyboard shortcuts", :hint => "Enable keyboard shortcuts", :collection => [["Yes", "true"], ["No", "false"]] %> - <%= f.input :enable_sequential_post_navigation, :as => :select, :label => "Enable post navigation", :hint => "Show prev/next links when viewing a post", :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %> <%= f.input :new_post_navigation_layout, :as => :select, :label => "Navigation bar position", :include_blank => false, :collection => [["Below", "true"], ["Above", "false"]], :hint => "When browsing pools or posts, place navigation links above or below the image" %> <%= f.input :hide_deleted_posts, :as => :select, :label => "Deleted post filter", :hint => "Remove deleted posts from search results", :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %> <%= f.input :show_deleted_children, :as => :select, :label => "Show deleted children", :hint => "Show thumbnail borders on parent posts even if the children are deleted", :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %>