Add option to make the landing page be /about even when trends are enabled (#20808)

* Add option to make the landing page be /about even when trends are enabled

* Restablish /explore as landing page by default
This commit is contained in:
Claire 2023-01-18 16:43:58 +01:00 committed by GitHub
parent 343e1fe8e9
commit 3970a6f433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 2 deletions

View File

@ -54,7 +54,7 @@ import {
About, About,
PrivacyPolicy, PrivacyPolicy,
} from './util/async-components'; } from './util/async-components';
import initialState, { me, owner, singleUserMode, showTrends } from '../../initial_state'; import initialState, { me, owner, singleUserMode, showTrends, trendsAsLanding } from '../../initial_state';
import { closeOnboarding, INTRODUCTION_VERSION } from 'mastodon/actions/onboarding'; import { closeOnboarding, INTRODUCTION_VERSION } from 'mastodon/actions/onboarding';
import Header from './components/header'; import Header from './components/header';
@ -163,7 +163,7 @@ class SwitchingColumnsArea extends React.PureComponent {
} }
} else if (singleUserMode && owner && initialState?.accounts[owner]) { } else if (singleUserMode && owner && initialState?.accounts[owner]) {
redirect = <Redirect from='/' to={`/@${initialState.accounts[owner].username}`} exact />; redirect = <Redirect from='/' to={`/@${initialState.accounts[owner].username}`} exact />;
} else if (showTrends) { } else if (showTrends && trendsAsLanding) {
redirect = <Redirect from='/' to='/explore' exact />; redirect = <Redirect from='/' to='/explore' exact />;
} else { } else {
redirect = <Redirect from='/' to='/about' exact />; redirect = <Redirect from='/' to='/about' exact />;

View File

@ -75,6 +75,7 @@
* @property {boolean} timeline_preview * @property {boolean} timeline_preview
* @property {string} title * @property {string} title
* @property {boolean} trends * @property {boolean} trends
* @property {boolean} trends_as_landing_page
* @property {boolean} unfollow_modal * @property {boolean} unfollow_modal
* @property {boolean} use_blurhash * @property {boolean} use_blurhash
* @property {boolean=} use_pending_items * @property {boolean=} use_pending_items
@ -126,6 +127,7 @@ export const singleUserMode = getMeta('single_user_mode');
export const source_url = getMeta('source_url'); export const source_url = getMeta('source_url');
export const timelinePreview = getMeta('timeline_preview'); export const timelinePreview = getMeta('timeline_preview');
export const title = getMeta('title'); export const title = getMeta('title');
export const trendsAsLanding = getMeta('trends_as_landing_page');
export const unfollowModal = getMeta('unfollow_modal'); export const unfollowModal = getMeta('unfollow_modal');
export const useBlurhash = getMeta('use_blurhash'); export const useBlurhash = getMeta('use_blurhash');
export const usePendingItems = getMeta('use_pending_items'); export const usePendingItems = getMeta('use_pending_items');

View File

@ -23,6 +23,7 @@ class Form::AdminSettings
thumbnail thumbnail
mascot mascot
trends trends
trends_as_landing_page
trendable_by_default trendable_by_default
show_domain_blocks show_domain_blocks
show_domain_blocks_rationale show_domain_blocks_rationale
@ -46,6 +47,7 @@ class Form::AdminSettings
preview_sensitive_media preview_sensitive_media
profile_directory profile_directory
trends trends
trends_as_landing_page
trendable_by_default trendable_by_default
noindex noindex
require_invite_text require_invite_text

View File

@ -32,6 +32,7 @@ class InitialStateSerializer < ActiveModel::Serializer
activity_api_enabled: Setting.activity_api_enabled, activity_api_enabled: Setting.activity_api_enabled,
single_user_mode: Rails.configuration.x.single_user_mode, single_user_mode: Rails.configuration.x.single_user_mode,
translation_enabled: TranslationService.configured?, translation_enabled: TranslationService.configured?,
trends_as_landing_page: Setting.trends_as_landing_page,
} }
if object.current_account if object.current_account

View File

@ -18,6 +18,9 @@
.fields-group .fields-group
= f.input :trends, as: :boolean, wrapper: :with_label = f.input :trends, as: :boolean, wrapper: :with_label
.fields-group
= f.input :trends_as_landing_page, as: :boolean, wrapper: :with_label
.fields-group .fields-group
= f.input :trendable_by_default, as: :boolean, wrapper: :with_label, recommended: :not_recommended = f.input :trendable_by_default, as: :boolean, wrapper: :with_label, recommended: :not_recommended

View File

@ -96,6 +96,7 @@ en:
timeline_preview: Logged out visitors will be able to browse the most recent public posts available on the server. timeline_preview: Logged out visitors will be able to browse the most recent public posts available on the server.
trendable_by_default: Skip manual review of trending content. Individual items can still be removed from trends after the fact. trendable_by_default: Skip manual review of trending content. Individual items can still be removed from trends after the fact.
trends: Trends show which posts, hashtags and news stories are gaining traction on your server. trends: Trends show which posts, hashtags and news stories are gaining traction on your server.
trends_as_landing_page: Show trending content to logged-out users and visitors instead of a description of this server. Requires trends to be enabled.
form_challenge: form_challenge:
current_password: You are entering a secure area current_password: You are entering a secure area
imports: imports:
@ -256,6 +257,7 @@ en:
timeline_preview: Allow unauthenticated access to public timelines timeline_preview: Allow unauthenticated access to public timelines
trendable_by_default: Allow trends without prior review trendable_by_default: Allow trends without prior review
trends: Enable trends trends: Enable trends
trends_as_landing_page: Use trends as the landing page
interactions: interactions:
must_be_follower: Block notifications from non-followers must_be_follower: Block notifications from non-followers
must_be_following: Block notifications from people you don't follow must_be_following: Block notifications from people you don't follow

View File

@ -35,6 +35,7 @@ defaults: &defaults
use_blurhash: true use_blurhash: true
use_pending_items: false use_pending_items: false
trends: true trends: true
trends_as_landing_page: true
trendable_by_default: false trendable_by_default: false
crop_images: true crop_images: true
notification_emails: notification_emails: