add in hometown's norss
https://github.com/glitch-soc/mastodon/pull/2002
This commit is contained in:
parent
efb7f0b66a
commit
b98a2f01be
12 changed files with 29 additions and 2 deletions
|
@ -24,6 +24,11 @@ class AccountsController < ApplicationController
|
|||
format.rss do
|
||||
expires_in 1.minute, public: true
|
||||
|
||||
if @account&.user&.setting_norss
|
||||
@statuses = []
|
||||
next
|
||||
end
|
||||
|
||||
limit = params[:limit].present? ? [params[:limit].to_i, PAGE_SIZE_MAX].min : PAGE_SIZE
|
||||
@statuses = filtered_statuses.without_reblogs.limit(limit)
|
||||
@statuses = cache_collection(@statuses, Status)
|
||||
|
|
|
@ -48,6 +48,7 @@ class Settings::PreferencesController < Settings::BaseController
|
|||
:setting_system_font_ui,
|
||||
:setting_system_emoji_font,
|
||||
:setting_noindex,
|
||||
:setting_norss,
|
||||
:setting_hide_followers_count,
|
||||
:setting_aggregate_reblogs,
|
||||
:setting_show_application,
|
||||
|
|
|
@ -6,6 +6,7 @@ module Settings
|
|||
flavour
|
||||
skin
|
||||
noindex
|
||||
norss
|
||||
).freeze
|
||||
|
||||
def initialize(object)
|
||||
|
|
|
@ -35,6 +35,7 @@ class UserSettingsDecorator
|
|||
user.settings['hide_followers_count'] = hide_followers_count_preference if change?('setting_hide_followers_count')
|
||||
user.settings['flavour'] = flavour_preference if change?('setting_flavour')
|
||||
user.settings['skin'] = skin_preference if change?('setting_skin')
|
||||
user.settings['norss'] = norss_preference if change?('setting_norss')
|
||||
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')
|
||||
|
@ -115,6 +116,10 @@ class UserSettingsDecorator
|
|||
settings['setting_flavour']
|
||||
end
|
||||
|
||||
def norss_preference
|
||||
boolean_cast_setting 'setting_norss'
|
||||
end
|
||||
|
||||
def skin_preference
|
||||
settings['setting_skin']
|
||||
end
|
||||
|
|
|
@ -34,6 +34,7 @@ class Form::AdminSettings
|
|||
show_domain_blocks
|
||||
show_domain_blocks_rationale
|
||||
noindex
|
||||
norss
|
||||
outgoing_spoilers
|
||||
require_invite_text
|
||||
captcha_enabled
|
||||
|
@ -62,6 +63,7 @@ class Form::AdminSettings
|
|||
trendable_by_default
|
||||
trending_status_cw
|
||||
noindex
|
||||
norss
|
||||
require_invite_text
|
||||
captcha_enabled
|
||||
).freeze
|
||||
|
|
|
@ -132,7 +132,7 @@ class User < ApplicationRecord
|
|||
has_many :session_activations, dependent: :destroy
|
||||
|
||||
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_followers_count,
|
||||
:reduce_motion, :system_font_ui, :noindex, :norss, :flavour, :skin, :display_media, :hide_followers_count,
|
||||
:expand_spoilers, :default_language, :aggregate_reblogs, :show_application,
|
||||
:advanced_layout, :use_blurhash, :use_pending_items, :trends, :crop_images, :visible_reactions,
|
||||
:disable_swiping, :always_send_emails, :default_content_type, :system_emoji_font,
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
- if @account.user_prefers_noindex?
|
||||
%meta{ name: 'robots', content: 'noindex, noarchive' }/
|
||||
|
||||
- if !@account.user&.setting_norss
|
||||
%link{ rel: 'alternate', type: 'application/rss+xml', href: @rss_url }/
|
||||
|
||||
%link{ rel: 'alternate', type: 'application/activity+json', href: ActivityPub::TagManager.instance.uri_for(@account) }/
|
||||
|
||||
- @account.fields.select(&:verifiable?).each do |field|
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
.fields-group
|
||||
= f.input :timeline_preview, as: :boolean, wrapper: :with_label
|
||||
|
||||
.fields-group
|
||||
= f.input :norss, as: :boolean, wrapper: :with_label, label: t('admin.settings.default_norss.title'), hint: t('admin.settings.default_norss.desc_html')
|
||||
|
||||
.fields-group
|
||||
= f.input :noindex, as: :boolean, wrapper: :with_label, label: t('admin.settings.default_noindex.title'), hint: t('admin.settings.default_noindex.desc_html')
|
||||
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
.fields-group
|
||||
= f.input :setting_noindex, as: :boolean, wrapper: :with_label
|
||||
|
||||
.fields-group
|
||||
= f.input :setting_norss, as: :boolean, wrapper: :with_label
|
||||
|
||||
.fields-group
|
||||
= f.input :setting_aggregate_reblogs, as: :boolean, wrapper: :with_label, recommended: true
|
||||
|
||||
|
|
|
@ -731,6 +731,9 @@ en:
|
|||
default_noindex:
|
||||
desc_html: Affects all users who have not changed this setting themselves
|
||||
title: Opt users out of search engine indexing by default
|
||||
default_norss:
|
||||
desc_html: Affects all users who have not changed this setting themselves
|
||||
title: Opt users out of having an RSS feed of their public posts by default
|
||||
discovery:
|
||||
follow_recommendations: Follow recommendations
|
||||
preamble: Surfacing interesting content is instrumental in onboarding new users who may not know anyone Mastodon. Control how various discovery features work on your server.
|
||||
|
|
|
@ -208,6 +208,7 @@ en:
|
|||
setting_expand_spoilers: Always expand posts marked with content warnings
|
||||
setting_hide_network: Hide your social graph
|
||||
setting_noindex: Opt-out of search engine indexing
|
||||
setting_norss: Opt-out of an RSS feed for your public posts
|
||||
setting_reduce_motion: Reduce motion in animations
|
||||
setting_show_application: Disclose application used to send posts
|
||||
setting_system_font_ui: Use system's default font
|
||||
|
|
|
@ -31,6 +31,7 @@ defaults: &defaults
|
|||
system_font_ui: false
|
||||
system_emoji_font: false
|
||||
noindex: false
|
||||
norss: false
|
||||
hide_followers_count: false
|
||||
flavour: 'glitch'
|
||||
skin: 'default'
|
||||
|
|
Loading…
Reference in a new issue