about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-04-16 14:48:46 -0500
committermultiple creatures <dev@multiple-creature.party>2019-05-21 03:16:22 -0500
commitcdacbb3c4c80c32b5845d3f1492c207ac3481375 (patch)
treed783934dd7e51f15967aef7ebf00d8edb34309cc /app
parent50fae175fd4286837af59c91a76bab49ed5e2556 (diff)
Add option to remove filtered roar placeholder gap.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/settings/preferences_controller.rb1
-rw-r--r--app/lib/user_settings_decorator.rb5
-rw-r--r--app/models/user.rb5
-rwxr-xr-xapp/views/layouts/application.html.haml4
-rw-r--r--app/views/settings/preferences/show.html.haml3
5 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb
index 52753e890..8cfc1de73 100644
--- a/app/controllers/settings/preferences_controller.rb
+++ b/app/controllers/settings/preferences_controller.rb
@@ -37,6 +37,7 @@ class Settings::PreferencesController < Settings::BaseController
       :setting_larger_menus,
       :setting_larger_buttons,
       :setting_larger_drawer,
+      :setting_remove_filtered,
       :setting_gently_kobolds,
       :setting_user_is_kobold,
 
diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb
index f2a4d9c9f..9d157df4e 100644
--- a/app/lib/user_settings_decorator.rb
+++ b/app/lib/user_settings_decorator.rb
@@ -22,6 +22,7 @@ class UserSettingsDecorator
     user.settings['larger_menus']        = larger_menus_preference if change?('setting_larger_menus')
     user.settings['larger_buttons']      = larger_buttons_preference if change?('setting_larger_buttons')
     user.settings['larger_drawer']       = larger_drawer_preference if change?('setting_larger_drawer')
+    user.settings['remove_filtered']     = remove_filtered_preference if change?('setting_remove_filtered')
     user.settings['gently_kobolds']      = gently_kobolds_preference if change?('setting_gently_kobolds')
     user.settings['user_is_kobold']      = user_is_kobold_preference if change?('setting_user_is_kobold')
 
@@ -62,6 +63,10 @@ class UserSettingsDecorator
     boolean_cast_setting 'setting_larger_drawer'
   end
 
+  def remove_filtered_preference
+    boolean_cast_setting 'setting_remove_filtered'
+  end
+
   def gently_kobolds_preference
     boolean_cast_setting 'setting_gently_kobolds'
   end
diff --git a/app/models/user.rb b/app/models/user.rb
index ac900d011..bcfc49115 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -111,6 +111,7 @@ class User < ApplicationRecord
     :larger_menus,
     :larger_buttons,
     :larger_drawer,
+    :remove_filtered,
     :gently_kobolds,
     :user_is_kobold,
 
@@ -227,6 +228,10 @@ class User < ApplicationRecord
     settings.larger_drawer || false
   end
 
+  def setting_remove_filtered
+    settings.remove_filtered || false
+  end
+
   def setting_gently_kobolds
     settings.gently_kobolds || false
   end
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 01ae25389..00d8af13a 100755
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -77,5 +77,9 @@
       :css
         .drawer { min-width: 400px !important }
 
+    - if current_account&.user&.setting_remove_filtered
+      :css
+        .status__wrapper--filtered { display: none !important; }
+
   %body{ class: body_classes }
     = content_for?(:content) ? yield(:content) : yield
diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml
index 945384204..bd5e8c532 100644
--- a/app/views/settings/preferences/show.html.haml
+++ b/app/views/settings/preferences/show.html.haml
@@ -63,6 +63,9 @@
     = f.input :setting_larger_drawer, as: :boolean, wrapper: :with_label
 
   .fields-group
+    = f.input :setting_remove_filtered, as: :boolean, wrapper: :with_label
+
+  .fields-group
     = f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label
     = f.input :setting_boost_modal, as: :boolean, wrapper: :with_label
     = f.input :setting_favourite_modal, as: :boolean, wrapper: :with_label