def initial_state_params
{
- settings: {},
+ settings: { known_fediverse: Setting.show_known_fediverse_at_about_page },
token: current_session&.token,
}
end
min_invite_role
activity_api_enabled
peers_api_enabled
+ show_known_fediverse_at_about_page
).freeze
BOOLEAN_SETTINGS = %w(
show_staff_badge
activity_api_enabled
peers_api_enabled
+ show_known_fediverse_at_about_page
).freeze
UPLOAD_SETTINGS = %w(
import { IntlProvider, addLocaleData } from 'react-intl';
import { getLocale } from '../locales';
import PublicTimeline from '../features/standalone/public_timeline';
+import CommunityTimeline from '../features/standalone/community_timeline';
import HashtagTimeline from '../features/standalone/hashtag_timeline';
import initialState from '../initial_state';
static propTypes = {
locale: PropTypes.string.isRequired,
hashtag: PropTypes.string,
+ showPublicTimeline: PropTypes.bool.isRequired,
+ };
+
+ static defaultProps = {
+ showPublicTimeline: initialState.settings.known_fediverse,
};
render () {
- const { locale, hashtag } = this.props;
+ const { locale, hashtag, showPublicTimeline } = this.props;
let timeline;
if (hashtag) {
timeline = <HashtagTimeline hashtag={hashtag} />;
- } else {
+ } else if (showPublicTimeline) {
timeline = <PublicTimeline />;
+ } else {
+ timeline = <CommunityTimeline />;
}
return (
--- /dev/null
+import React from 'react';
+import { connect } from 'react-redux';
+import PropTypes from 'prop-types';
+import StatusListContainer from '../../ui/containers/status_list_container';
+import {
+ refreshCommunityTimeline,
+ expandCommunityTimeline,
+} from '../../../actions/timelines';
+import Column from '../../../components/column';
+import ColumnHeader from '../../../components/column_header';
+import { defineMessages, injectIntl } from 'react-intl';
+import { connectCommunityStream } from '../../../actions/streaming';
+
+const messages = defineMessages({
+ title: { id: 'standalone.public_title', defaultMessage: 'A look inside...' },
+});
+
+@connect()
+@injectIntl
+export default class CommunityTimeline extends React.PureComponent {
+
+ static propTypes = {
+ dispatch: PropTypes.func.isRequired,
+ intl: PropTypes.object.isRequired,
+ };
+
+ handleHeaderClick = () => {
+ this.column.scrollTop();
+ }
+
+ setRef = c => {
+ this.column = c;
+ }
+
+ componentDidMount () {
+ const { dispatch } = this.props;
+
+ dispatch(refreshCommunityTimeline());
+ this.disconnect = dispatch(connectCommunityStream());
+ }
+
+ componentWillUnmount () {
+ if (this.disconnect) {
+ this.disconnect();
+ this.disconnect = null;
+ }
+ }
+
+ handleLoadMore = () => {
+ this.props.dispatch(expandCommunityTimeline());
+ }
+
+ render () {
+ const { intl } = this.props;
+
+ return (
+ <Column ref={this.setRef}>
+ <ColumnHeader
+ icon='users'
+ title={intl.formatMessage(messages.title)}
+ onClick={this.handleHeaderClick}
+ />
+
+ <StatusListContainer
+ timelineId='community'
+ loadMore={this.handleLoadMore}
+ scrollKey='standalone_public_timeline'
+ trackScroll={false}
+ />
+ </Column>
+ );
+ }
+
+}
],
"path": "app/javascript/mastodon/features/public_timeline/index.json"
},
+ {
+ "descriptors": [
+ {
+ "defaultMessage": "A look inside...",
+ "id": "standalone.public_title"
+ }
+ ],
+ "path": "app/javascript/mastodon/features/standalone/community_timeline/index.json"
+ },
{
"descriptors": [
{
:activity_api_enabled=,
:peers_api_enabled,
:peers_api_enabled=,
+ :show_known_fediverse_at_about_page,
+ :show_known_fediverse_at_about_page=,
to: Setting
)
end
.fields-group
= f.input :timeline_preview, as: :boolean, wrapper: :with_label, label: t('admin.settings.timeline_preview.title'), hint: t('admin.settings.timeline_preview.desc_html')
+ .fields-group
+ = f.input :show_known_fediverse_at_about_page, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_known_fediverse_at_about_page.title'), hint: t('admin.settings.show_known_fediverse_at_about_page.desc_html')
+
.fields-group
= f.input :show_staff_badge, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_staff_badge.title'), hint: t('admin.settings.show_staff_badge.desc_html')
open:
desc_html: Allow anyone to create an account
title: Open registration
+ show_known_fediverse_at_about_page:
+ desc_html: When toggled, it will show toots from all the known fediverse on preview. Otherwise it will only show local toots.
+ title: Show known fediverse on timeline preview
show_staff_badge:
desc_html: Show a staff badge on a user page
title: Show staff badge
open:
desc_html: Pozwól każdemu na założenie konta
title: Otwarta rejestracja
+ show_known_fediverse_at_about_page:
+ desc_html: Jeśli włączone, podgląd instancji będzie wyświetlał wpisy z całego Fediwersum. W innym przypadku, będą wyświetlane tylko lokalne wpisy.
+ title: Pokazuj wszystkie znane wpisy na podglądzie instancji
show_staff_badge:
desc_html: Pokazuj odznakę uprawnień na stronie profilu użytkownika
title: Pokazuj odznakę administracji
open:
desc_html: Permitir que qualquer um crie uma conta
title: Cadastro aberto
+ show_known_fediverse_at_about_page:
+ desc_html: Quando ligado, vai mostrar toots de todo o fediverso conhecido na prévia da timeline. Senão, mostra somente toots locais.
+ title: Mostrar fediverso conhecido na prévia da timeline
show_staff_badge:
desc_html: Mostrar uma insígnia de Equipe na página de usuário
title: Mostrar insígnia de equipe
bootstrap_timeline_accounts: ''
activity_api_enabled: true
peers_api_enabled: true
+ show_known_fediverse_at_about_page: true
development:
<<: *defaults