From 9d4a4efa7a99ddd1b4a90d90f31d17bfeecc5ac0 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sun, 17 Nov 2019 21:39:33 -0600 Subject: Add a new profile option to filter posts with undescribed media. At some point, figure out how to put this under Filters, even if it angers the MVC model gods. No gods, no masters. --- app/controllers/settings/profiles_controller.rb | 2 +- app/views/settings/profiles/show.html.haml | 5 +++++ config/locales/simple_form.en.yml | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/settings/profiles_controller.rb b/app/controllers/settings/profiles_controller.rb index f9008727e..183dcdcfc 100644 --- a/app/controllers/settings/profiles_controller.rb +++ b/app/controllers/settings/profiles_controller.rb @@ -27,7 +27,7 @@ class Settings::ProfilesController < Settings::BaseController private def account_params - params.require(:account).permit(:display_name, :note, :avatar, :header, :replies, :locked, :hidden, :unlisted, :block_anon, :gently, :kobold, :adult_content, :bot, :discoverable, fields_attributes: [:name, :value]) + params.require(:account).permit(:display_name, :note, :avatar, :header, :replies, :locked, :hidden, :unlisted, :block_anon, :gently, :kobold, :adult_content, :bot, :discoverable, :filter_undescribed, fields_attributes: [:name, :value]) end def set_account diff --git a/app/views/settings/profiles/show.html.haml b/app/views/settings/profiles/show.html.haml index 4fabfb9f4..35135267c 100644 --- a/app/views/settings/profiles/show.html.haml +++ b/app/views/settings/profiles/show.html.haml @@ -43,6 +43,11 @@ %hr.spacer/ + .fields-group + = f.input :filter_undescribed, as: :boolean, wrapper: :with_label + + %hr.spacer/ + .fields-row .fields-row__column.fields-group.fields-row__column-6 .input.with_block_label diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 6e738c52e..cb387d6bf 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -187,6 +187,8 @@ en: desc: Filter roars with matching media descriptions no_desc: Filter roars WITHOUT media descriptions override_cw: Override existing content warning + + filter_undescribed: Hide roars without media descriptions boost_interval: 1: 1 minute 2: 2 minutes -- cgit