From d37f426f95f812b44925e13c00eabb9d1cd76b1f Mon Sep 17 00:00:00 2001 From: Claire Date: Sat, 12 Nov 2022 13:24:53 +0100 Subject: [PATCH] Add back missing glitch-soc admin settings (#1919) Fixes #1890 --- .../admin/settings/other_controller.rb | 9 +++++++ app/views/admin/settings/other/show.html.haml | 26 +++++++++++++++++++ .../admin/settings/shared/_links.html.haml | 1 + config/locales-glitch/en.yml | 3 +++ config/routes.rb | 1 + 5 files changed, 40 insertions(+) create mode 100644 app/controllers/admin/settings/other_controller.rb create mode 100644 app/views/admin/settings/other/show.html.haml diff --git a/app/controllers/admin/settings/other_controller.rb b/app/controllers/admin/settings/other_controller.rb new file mode 100644 index 00000000000..c7bfa3d5867 --- /dev/null +++ b/app/controllers/admin/settings/other_controller.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class Admin::Settings::OtherController < Admin::SettingsController + private + + def after_update_redirect_path + admin_settings_other_path + end +end diff --git a/app/views/admin/settings/other/show.html.haml b/app/views/admin/settings/other/show.html.haml new file mode 100644 index 00000000000..1a7a4e46e54 --- /dev/null +++ b/app/views/admin/settings/other/show.html.haml @@ -0,0 +1,26 @@ +- content_for :page_title do + = t('admin.settings.other.title') + +- content_for :heading do + %h2= t('admin.settings.title') + = render partial: 'admin/settings/shared/links' + += simple_form_for @admin_settings, url: admin_settings_other_path, html: { method: :patch } do |f| + = render 'shared/error_messages', object: @admin_settings + + %p.lead= t('admin.settings.other.preamble') + + .fields-group + = f.input :hide_followers_count, as: :boolean, wrapper: :with_label, label: t('admin.settings.hide_followers_count.title'), hint: t('admin.settings.hide_followers_count.desc_html'), glitch_only: true + + .fields-group + = f.input :show_reblogs_in_public_timelines, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_reblogs_in_public_timelines.title'), hint: t('admin.settings.show_reblogs_in_public_timelines.desc_html'), glitch_only: true + + .fields-group + = f.input :show_replies_in_public_timelines, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_replies_in_public_timelines.title'), hint: t('admin.settings.show_replies_in_public_timelines.desc_html'), glitch_only: true + + .fields-group + = f.input :outgoing_spoilers, wrapper: :with_label, label: t('admin.settings.outgoing_spoilers.title'), hint: t('admin.settings.outgoing_spoilers.desc_html'), glitch_only: true + + .actions + = f.button :button, t('generic.save_changes'), type: :submit diff --git a/app/views/admin/settings/shared/_links.html.haml b/app/views/admin/settings/shared/_links.html.haml index 1294c26ce1f..9f2cdd3f3e8 100644 --- a/app/views/admin/settings/shared/_links.html.haml +++ b/app/views/admin/settings/shared/_links.html.haml @@ -6,3 +6,4 @@ - primary.item :discovery, safe_join([fa_icon('search fw'), t('admin.settings.discovery.title')]), admin_settings_discovery_path - primary.item :content_retention, safe_join([fa_icon('history fw'), t('admin.settings.content_retention.title')]), admin_settings_content_retention_path - primary.item :appearance, safe_join([fa_icon('desktop fw'), t('admin.settings.appearance.title')]), admin_settings_appearance_path + - primary.item :other, safe_join([fa_icon('ellipsis-h fw'), t('admin.settings.other.title')]), admin_settings_other_path diff --git a/config/locales-glitch/en.yml b/config/locales-glitch/en.yml index 4cdc81a2481..c559ee0ecab 100644 --- a/config/locales-glitch/en.yml +++ b/config/locales-glitch/en.yml @@ -33,6 +33,9 @@ en: title: Enable keybase integration flavour_and_skin: title: Flavour and skin + other: + preamble: Various glitch-soc settings not fitting in other categories. + title: Other outgoing_spoilers: desc_html: When federating toots, add this content warning to toots that do not have one. It is useful if your server is specialized in content other servers might want to have under a Content Warning. Media will also be marked as sensitive. title: Content warning for outgoing toots diff --git a/config/routes.rb b/config/routes.rb index 126eae08417..e1068bb583a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -274,6 +274,7 @@ Rails.application.routes.draw do resource :about, only: [:show, :update], controller: 'about' resource :appearance, only: [:show, :update], controller: 'appearance' resource :discovery, only: [:show, :update], controller: 'discovery' + resource :other, only: [:show, :update], controller: 'other' end resources :site_uploads, only: [:destroy]