From: Thibaut Girka Date: Wed, 7 Aug 2019 11:56:48 +0000 (+0200) Subject: Merge branch 'master' into glitch-soc/merge-upstream X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=04534604c654060eca24628247fdb51b7ff5372a;p=mastodon.git Merge branch 'master' into glitch-soc/merge-upstream Conflicts: - app/models/user.rb - app/serializers/initial_state_serializer.rb - app/views/admin/dashboard/index.html.haml - config/locales/simple_form.en.yml --- 04534604c654060eca24628247fdb51b7ff5372a diff --cc app/controllers/admin/dashboard_controller.rb index 4f4341918,ab56065e0..92bf7fbb9 --- a/app/controllers/admin/dashboard_controller.rb +++ b/app/controllers/admin/dashboard_controller.rb @@@ -28,10 -28,12 +28,13 @@@ module Admi @pam_enabled = ENV['PAM_ENABLED'] == 'true' @hidden_service = ENV['ALLOW_ACCESS_TO_HIDDEN_SERVICE'] == 'true' @trending_hashtags = TrendingTags.get(10, filtered: false) + @authorized_fetch = authorized_fetch_mode? + @whitelist_enabled = whitelist_mode? @profile_directory = Setting.profile_directory @timeline_preview = Setting.timeline_preview + @keybase_integration = Setting.enable_keybase @spam_check_enabled = Setting.spam_check_enabled + @trends_enabled = Setting.trends end private diff --cc app/controllers/settings/preferences_controller.rb index ea4491d1e,edf29947b..418ea5d7a --- a/app/controllers/settings/preferences_controller.rb +++ b/app/controllers/settings/preferences_controller.rb @@@ -55,9 -54,9 +55,10 @@@ class Settings::PreferencesController :setting_aggregate_reblogs, :setting_show_application, :setting_advanced_layout, + :setting_default_content_type, :setting_use_blurhash, :setting_use_pending_items, + :setting_trends, notification_emails: %i(follow follow_request reblog favourite mention digest report pending_account trending_tag), interactions: %i(must_be_follower must_be_following must_be_following_dm) ) diff --cc app/lib/user_settings_decorator.rb index 51d8c0970,3568a3e11..a52172707 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@@ -37,9 -34,9 +37,10 @@@ class UserSettingsDecorato user.settings['aggregate_reblogs'] = aggregate_reblogs_preference if change?('setting_aggregate_reblogs') user.settings['show_application'] = show_application_preference if change?('setting_show_application') user.settings['advanced_layout'] = advanced_layout_preference if change?('setting_advanced_layout') + user.settings['default_content_type']= default_content_type_preference if change?('setting_default_content_type') user.settings['use_blurhash'] = use_blurhash_preference if change?('setting_use_blurhash') user.settings['use_pending_items'] = use_pending_items_preference if change?('setting_use_pending_items') + user.settings['trends'] = trends_preference if change?('setting_trends') end def merged_notification_emails diff --cc app/models/form/admin_settings.rb index ecaed44f6,051268375..2c3a7f13b --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@@ -32,9 -28,8 +32,10 @@@ class Form::AdminSetting thumbnail hero mascot + show_reblogs_in_public_timelines + show_replies_in_public_timelines spam_check_enabled + trends ).freeze BOOLEAN_KEYS = %i( @@@ -46,11 -41,8 +47,12 @@@ show_known_fediverse_at_about_page preview_sensitive_media profile_directory + hide_followers_count + enable_keybase + show_reblogs_in_public_timelines + show_replies_in_public_timelines spam_check_enabled + trends ).freeze UPLOAD_KEYS = %i( diff --cc app/models/user.rb index 67cf92307,a4a20d975..45a4b8989 --- a/app/models/user.rb +++ b/app/models/user.rb @@@ -104,10 -104,11 +104,12 @@@ class User < ApplicationRecor has_many :session_activations, dependent: :destroy - delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :delete_modal, - :reduce_motion, :system_font_ui, :noindex, :theme, :display_media, :hide_network, + delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :favourite_modal, :delete_modal, + :reduce_motion, :system_font_ui, :noindex, :flavour, :skin, :display_media, :hide_network, :hide_followers_count, :expand_spoilers, :default_language, :aggregate_reblogs, :show_application, - :advanced_layout, :default_content_type, :use_blurhash, :use_pending_items, :use_pending_items, to: :settings, prefix: :setting, allow_nil: false + :advanced_layout, :use_blurhash, :use_pending_items, :trends, ++ :default_content_type, + to: :settings, prefix: :setting, allow_nil: false attr_reader :invite_code attr_writer :external diff --cc app/serializers/initial_state_serializer.rb index e22059182,c92c5e606..c8da6e725 --- a/app/serializers/initial_state_serializer.rb +++ b/app/serializers/initial_state_serializer.rb @@@ -50,7 -36,7 +51,8 @@@ class InitialStateSerializer < ActiveMo store[:use_blurhash] = object.current_account.user.setting_use_blurhash store[:use_pending_items] = object.current_account.user.setting_use_pending_items store[:is_staff] = object.current_account.user.staff? + store[:trends] = Setting.trends && object.current_account.user.setting_trends + store[:default_content_type] = object.current_account.user.setting_default_content_type end store diff --cc app/views/admin/dashboard/index.html.haml index d3ac3ff42,f567b81e8..3c98da35f --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@@ -49,8 -49,8 +49,10 @@@ = feature_hint(link_to(t('admin.dashboard.feature_profile_directory'), edit_admin_settings_path), @profile_directory) %li = feature_hint(link_to(t('admin.dashboard.feature_timeline_preview'), edit_admin_settings_path), @timeline_preview) + %li + = feature_hint(link_to(t('admin.dashboard.keybase'), edit_admin_settings_path), @keybase_integration) + %li + = feature_hint(link_to(t('admin.dashboard.trends'), edit_admin_settings_path), @trends_enabled) %li = feature_hint(link_to(t('admin.dashboard.feature_relay'), admin_relays_path), @relay_enabled) %li diff --cc app/views/admin/settings/edit.html.haml index efe6ea56b,28c0ece15..b0ab394d6 --- a/app/views/admin/settings/edit.html.haml +++ b/app/views/admin/settings/edit.html.haml @@@ -68,18 -68,9 +68,21 @@@ .fields-group = f.input :profile_directory, as: :boolean, wrapper: :with_label, label: t('admin.settings.profile_directory.title'), hint: t('admin.settings.profile_directory.desc_html') + .fields-group + = f.input :trends, as: :boolean, wrapper: :with_label, label: t('admin.settings.trends.title'), hint: t('admin.settings.trends.desc_html') + + .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') + + .fields-group + = f.input :enable_keybase, as: :boolean, wrapper: :with_label, label: t('admin.settings.enable_keybase.title'), hint: t('admin.settings.enable_keybase.desc_html') + + .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') + + .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') + .fields-group = f.input :spam_check_enabled, as: :boolean, wrapper: :with_label, label: t('admin.settings.spam_check_enabled.title'), hint: t('admin.settings.spam_check_enabled.desc_html') diff --cc config/locales/simple_form.en.yml index 82e129581,e15d5904f..5da0cc45d --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@@ -123,8 -112,9 +123,10 @@@ en setting_noindex: Opt-out of search engine indexing setting_reduce_motion: Reduce motion in animations setting_show_application: Disclose application used to send toots + setting_skin: Skin setting_system_font_ui: Use system's default font + setting_theme: Site theme + setting_trends: Show today's trends setting_unfollow_modal: Show confirmation dialog before unfollowing someone setting_use_blurhash: Show colorful gradients for hidden media setting_use_pending_items: Slow mode