Conflicts: app/javascript/mastodon/features/getting_started/index.js app/javascript/packs/public.js app/javascript/styles/components.scssmain
commit
67ad453373
@ -0,0 +1,39 @@
|
|||||||
|
import api from '../api';
|
||||||
|
|
||||||
|
export const PINNED_STATUSES_FETCH_REQUEST = 'PINNED_STATUSES_FETCH_REQUEST';
|
||||||
|
export const PINNED_STATUSES_FETCH_SUCCESS = 'PINNED_STATUSES_FETCH_SUCCESS';
|
||||||
|
export const PINNED_STATUSES_FETCH_FAIL = 'PINNED_STATUSES_FETCH_FAIL';
|
||||||
|
|
||||||
|
export function fetchPinnedStatuses() {
|
||||||
|
return (dispatch, getState) => {
|
||||||
|
dispatch(fetchPinnedStatusesRequest());
|
||||||
|
|
||||||
|
const accountId = getState().getIn(['meta', 'me']);
|
||||||
|
api(getState).get(`/api/v1/accounts/${accountId}/statuses`, { params: { pinned: true } }).then(response => {
|
||||||
|
dispatch(fetchPinnedStatusesSuccess(response.data, null));
|
||||||
|
}).catch(error => {
|
||||||
|
dispatch(fetchPinnedStatusesFail(error));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export function fetchPinnedStatusesRequest() {
|
||||||
|
return {
|
||||||
|
type: PINNED_STATUSES_FETCH_REQUEST,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export function fetchPinnedStatusesSuccess(statuses, next) {
|
||||||
|
return {
|
||||||
|
type: PINNED_STATUSES_FETCH_SUCCESS,
|
||||||
|
statuses,
|
||||||
|
next,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export function fetchPinnedStatusesFail(error) {
|
||||||
|
return {
|
||||||
|
type: PINNED_STATUSES_FETCH_FAIL,
|
||||||
|
error,
|
||||||
|
};
|
||||||
|
};
|
@ -0,0 +1,59 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
|
import { fetchPinnedStatuses } from '../../actions/pin_statuses';
|
||||||
|
import Column from '../ui/components/column';
|
||||||
|
import ColumnBackButtonSlim from '../../components/column_back_button_slim';
|
||||||
|
import StatusList from '../../components/status_list';
|
||||||
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
|
|
||||||
|
const messages = defineMessages({
|
||||||
|
heading: { id: 'column.pins', defaultMessage: 'Pinned toot' },
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapStateToProps = state => ({
|
||||||
|
statusIds: state.getIn(['status_lists', 'pins', 'items']),
|
||||||
|
hasMore: !!state.getIn(['status_lists', 'pins', 'next']),
|
||||||
|
});
|
||||||
|
|
||||||
|
@connect(mapStateToProps)
|
||||||
|
@injectIntl
|
||||||
|
export default class PinnedStatuses extends ImmutablePureComponent {
|
||||||
|
|
||||||
|
static propTypes = {
|
||||||
|
dispatch: PropTypes.func.isRequired,
|
||||||
|
statusIds: ImmutablePropTypes.list.isRequired,
|
||||||
|
intl: PropTypes.object.isRequired,
|
||||||
|
hasMore: PropTypes.bool.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
componentWillMount () {
|
||||||
|
this.props.dispatch(fetchPinnedStatuses());
|
||||||
|
}
|
||||||
|
|
||||||
|
handleHeaderClick = () => {
|
||||||
|
this.column.scrollTop();
|
||||||
|
}
|
||||||
|
|
||||||
|
setRef = c => {
|
||||||
|
this.column = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
render () {
|
||||||
|
const { intl, statusIds, hasMore } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Column icon='thumb-tack' heading={intl.formatMessage(messages.heading)} ref={this.setRef}>
|
||||||
|
<ColumnBackButtonSlim />
|
||||||
|
<StatusList
|
||||||
|
statusIds={statusIds}
|
||||||
|
scrollKey='pinned_statuses'
|
||||||
|
hasMore={hasMore}
|
||||||
|
/>
|
||||||
|
</Column>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,16 +1,17 @@
|
|||||||
%table.table
|
.table-wrapper
|
||||||
%tbody
|
%table.table
|
||||||
%tr
|
%tbody
|
||||||
%td= t('admin.accounts.show.created_reports')
|
|
||||||
%td= link_to pluralize(account.reports.count, t('admin.accounts.show.report')), admin_reports_path(account_id: account.id)
|
|
||||||
%tr
|
|
||||||
%td= t('admin.accounts.show.targeted_reports')
|
|
||||||
%td= link_to pluralize(account.targeted_reports.count, t('admin.accounts.show.report')), admin_reports_path(target_account_id: account.id)
|
|
||||||
- if account.silenced? || account.suspended?
|
|
||||||
%tr
|
%tr
|
||||||
%td= t('admin.accounts.moderation.title')
|
%td= t('admin.accounts.show.created_reports')
|
||||||
%td
|
%td= link_to pluralize(account.reports.count, t('admin.accounts.show.report')), admin_reports_path(account_id: account.id)
|
||||||
- if account.silenced?
|
%tr
|
||||||
%p= t('admin.accounts.moderation.silenced')
|
%td= t('admin.accounts.show.targeted_reports')
|
||||||
- if account.suspended?
|
%td= link_to pluralize(account.targeted_reports.count, t('admin.accounts.show.report')), admin_reports_path(target_account_id: account.id)
|
||||||
%p= t('admin.accounts.moderation.suspended')
|
- if account.silenced? || account.suspended?
|
||||||
|
%tr
|
||||||
|
%td= t('admin.accounts.moderation.title')
|
||||||
|
%td
|
||||||
|
- if account.silenced?
|
||||||
|
%p= t('admin.accounts.moderation.silenced')
|
||||||
|
- if account.suspended?
|
||||||
|
%p= t('admin.accounts.moderation.suspended')
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= t('admin.domain_blocks.title')
|
= t('admin.domain_blocks.title')
|
||||||
|
|
||||||
%table.table
|
.table-wrapper
|
||||||
%thead
|
%table.table
|
||||||
%tr
|
%thead
|
||||||
%th= t('admin.domain_blocks.domain')
|
%tr
|
||||||
%th= t('admin.domain_blocks.severity')
|
%th= t('admin.domain_blocks.domain')
|
||||||
%th= t('admin.domain_blocks.reject_media')
|
%th= t('admin.domain_blocks.severity')
|
||||||
%th
|
%th= t('admin.domain_blocks.reject_media')
|
||||||
%tbody
|
%th
|
||||||
= render @domain_blocks
|
%tbody
|
||||||
|
= render @domain_blocks
|
||||||
|
|
||||||
= paginate @domain_blocks
|
= paginate @domain_blocks
|
||||||
= link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path, class: 'button'
|
= link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path, class: 'button'
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= t('admin.instances.title')
|
= t('admin.instances.title')
|
||||||
|
|
||||||
%table.table
|
.table-wrapper
|
||||||
%thead
|
%table.table
|
||||||
%tr
|
%thead
|
||||||
%th= t('admin.instances.domain_name')
|
%tr
|
||||||
%th= t('admin.instances.account_count')
|
%th= t('admin.instances.domain_name')
|
||||||
%tbody
|
%th= t('admin.instances.account_count')
|
||||||
= render @instances
|
%tbody
|
||||||
|
= render @instances
|
||||||
|
|
||||||
= paginate paginated_instances
|
= paginate paginated_instances
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= t('admin.subscriptions.title')
|
= t('admin.subscriptions.title')
|
||||||
|
|
||||||
%table.table
|
.table-wrapper
|
||||||
%thead
|
%table.table
|
||||||
%tr
|
%thead
|
||||||
%th= t('admin.subscriptions.topic')
|
%tr
|
||||||
%th= t('admin.subscriptions.callback_url')
|
%th= t('admin.subscriptions.topic')
|
||||||
%th= t('admin.subscriptions.confirmed')
|
%th= t('admin.subscriptions.callback_url')
|
||||||
%th= t('admin.subscriptions.expires_in')
|
%th= t('admin.subscriptions.confirmed')
|
||||||
%th= t('admin.subscriptions.last_delivery')
|
%th= t('admin.subscriptions.expires_in')
|
||||||
%tbody
|
%th= t('admin.subscriptions.last_delivery')
|
||||||
= render @subscriptions
|
%tbody
|
||||||
|
= render @subscriptions
|
||||||
|
|
||||||
= paginate @subscriptions
|
= paginate @subscriptions
|
||||||
|
@ -1,28 +1,29 @@
|
|||||||
%h6= t 'sessions.title'
|
%h6= t 'sessions.title'
|
||||||
%p.muted-hint= t 'sessions.explanation'
|
%p.muted-hint= t 'sessions.explanation'
|
||||||
|
|
||||||
%table.table.inline-table
|
.table-wrapper
|
||||||
%thead
|
%table.table.inline-table
|
||||||
%tr
|
%thead
|
||||||
%th= t 'sessions.browser'
|
|
||||||
%th= t 'sessions.ip'
|
|
||||||
%th= t 'sessions.activity'
|
|
||||||
%td
|
|
||||||
%tbody
|
|
||||||
- @sessions.each do |session|
|
|
||||||
%tr
|
%tr
|
||||||
|
%th= t 'sessions.browser'
|
||||||
|
%th= t 'sessions.ip'
|
||||||
|
%th= t 'sessions.activity'
|
||||||
%td
|
%td
|
||||||
%span{ title: session.user_agent }<
|
%tbody
|
||||||
= fa_icon "#{session_device_icon(session)} fw", 'aria-label' => session_device_icon(session)
|
- @sessions.each do |session|
|
||||||
= ' '
|
%tr
|
||||||
= t 'sessions.description', browser: t("sessions.browsers.#{session.browser}"), platform: t("sessions.platforms.#{session.platform}")
|
%td
|
||||||
%td
|
%span{ title: session.user_agent }<
|
||||||
%samp= session.ip
|
= fa_icon "#{session_device_icon(session)} fw", 'aria-label' => session_device_icon(session)
|
||||||
%td
|
= ' '
|
||||||
- if current_session.session_id == session.session_id
|
= t 'sessions.description', browser: t("sessions.browsers.#{session.browser}"), platform: t("sessions.platforms.#{session.platform}")
|
||||||
= t 'sessions.current_session'
|
%td
|
||||||
- else
|
%samp= session.ip
|
||||||
%time.time-ago{ datetime: session.updated_at.iso8601, title: l(session.updated_at) }= l(session.updated_at)
|
%td
|
||||||
%td
|
- if current_session.session_id == session.session_id
|
||||||
- if current_session.session_id != session.session_id
|
= t 'sessions.current_session'
|
||||||
= table_link_to 'times', t('sessions.revoke'), settings_session_path(session), method: :delete
|
- else
|
||||||
|
%time.time-ago{ datetime: session.updated_at.iso8601, title: l(session.updated_at) }= l(session.updated_at)
|
||||||
|
%td
|
||||||
|
- if current_session.session_id != session.session_id
|
||||||
|
= table_link_to 'times', t('sessions.revoke'), settings_session_path(session), method: :delete
|
||||||
|
@ -1,23 +1,24 @@
|
|||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= t('doorkeeper.authorized_applications.index.title')
|
= t('doorkeeper.authorized_applications.index.title')
|
||||||
|
|
||||||
%table.table
|
.table-wrapper
|
||||||
%thead
|
%table.table
|
||||||
%tr
|
%thead
|
||||||
%th= t('doorkeeper.authorized_applications.index.application')
|
|
||||||
%th= t('doorkeeper.authorized_applications.index.scopes')
|
|
||||||
%th= t('doorkeeper.authorized_applications.index.created_at')
|
|
||||||
%th
|
|
||||||
%tbody
|
|
||||||
- @applications.each do |application|
|
|
||||||
%tr
|
%tr
|
||||||
%td
|
%th= t('doorkeeper.authorized_applications.index.application')
|
||||||
- if application.website.blank?
|
%th= t('doorkeeper.authorized_applications.index.scopes')
|
||||||
= application.name
|
%th= t('doorkeeper.authorized_applications.index.created_at')
|
||||||
- else
|
%th
|
||||||
= link_to application.name, application.website, target: '_blank', rel: 'noopener'
|
%tbody
|
||||||
%th!= application.scopes.map { |scope| t(scope, scope: [:doorkeeper, :scopes]) }.join('<br />')
|
- @applications.each do |application|
|
||||||
%td= l application.created_at
|
%tr
|
||||||
%td
|
%td
|
||||||
- unless application.superapp?
|
- if application.website.blank?
|
||||||
= table_link_to 'times', t('doorkeeper.authorized_applications.buttons.revoke'), oauth_authorized_application_path(application), method: :delete, data: { confirm: t('doorkeeper.authorized_applications.confirmations.revoke') }
|
= application.name
|
||||||
|
- else
|
||||||
|
= link_to application.name, application.website, target: '_blank', rel: 'noopener'
|
||||||
|
%th!= application.scopes.map { |scope| t(scope, scope: [:doorkeeper, :scopes]) }.join('<br />')
|
||||||
|
%td= l application.created_at
|
||||||
|
%td
|
||||||
|
- unless application.superapp?
|
||||||
|
= table_link_to 'times', t('doorkeeper.authorized_applications.buttons.revoke'), oauth_authorized_application_path(application), method: :delete, data: { confirm: t('doorkeeper.authorized_applications.confirmations.revoke') }
|
||||||
|
@ -1,19 +1,20 @@
|
|||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= t('doorkeeper.applications.index.title')
|
= t('doorkeeper.applications.index.title')
|
||||||
|
|
||||||
%table.table
|
.table-wrapper
|
||||||
%thead
|
%table.table
|
||||||
%tr
|
%thead
|
||||||
%th= t('doorkeeper.applications.index.application')
|
|
||||||
%th= t('doorkeeper.applications.index.scopes')
|
|
||||||
%th
|
|
||||||
%tbody
|
|
||||||
- @applications.each do |application|
|
|
||||||
%tr
|
%tr
|
||||||
%td= link_to application.name, settings_application_path(application)
|
%th= t('doorkeeper.applications.index.application')
|
||||||
%th= application.scopes
|
%th= t('doorkeeper.applications.index.scopes')
|
||||||
%td
|
%th
|
||||||
= table_link_to 'times', t('doorkeeper.applications.index.delete'), settings_application_path(application), method: :delete, data: { confirm: t('doorkeeper.applications.confirmations.destroy') }
|
%tbody
|
||||||
|
- @applications.each do |application|
|
||||||
|
%tr
|
||||||
|
%td= link_to application.name, settings_application_path(application)
|
||||||
|
%th= application.scopes
|
||||||
|
%td
|
||||||
|
= table_link_to 'times', t('doorkeeper.applications.index.delete'), settings_application_path(application), method: :delete, data: { confirm: t('doorkeeper.applications.confirmations.destroy') }
|
||||||
|
|
||||||
= paginate @applications
|
= paginate @applications
|
||||||
= link_to t('doorkeeper.applications.index.new'), new_settings_application_path, class: 'button'
|
= link_to t('doorkeeper.applications.index.new'), new_settings_application_path, class: 'button'
|
||||||
|
@ -1,21 +1,22 @@
|
|||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= t('settings.export')
|
= t('settings.export')
|
||||||
|
|
||||||
%table.table
|
.table-wrapper
|
||||||
%tbody
|
%table.table
|
||||||
%tr
|
%tbody
|
||||||
%th= t('exports.storage')
|
%tr
|
||||||
%td= number_to_human_size @export.total_storage
|
%th= t('exports.storage')
|
||||||
%td
|
%td= number_to_human_size @export.total_storage
|
||||||
%tr
|
%td
|
||||||
%th= t('exports.follows')
|
%tr
|
||||||
%td= @export.total_follows
|
%th= t('exports.follows')
|
||||||
%td= table_link_to 'download', t('exports.csv'), settings_exports_follows_path(format: :csv)
|
%td= @export.total_follows
|
||||||
%tr
|
%td= table_link_to 'download', t('exports.csv'), settings_exports_follows_path(format: :csv)
|
||||||
%th= t('exports.blocks')
|
%tr
|
||||||
%td= @export.total_blocks
|
%th= t('exports.blocks')
|
||||||
%td= table_link_to 'download', t('exports.csv'), settings_exports_blocks_path(format: :csv)
|
%td= @export.total_blocks
|
||||||
%tr
|
%td= table_link_to 'download', t('exports.csv'), settings_exports_blocks_path(format: :csv)
|
||||||
%th= t('exports.mutes')
|
%tr
|
||||||
%td= @export.total_mutes
|
%th= t('exports.mutes')
|
||||||
%td= table_link_to 'download', t('exports.csv'), settings_exports_mutes_path(format: :csv)
|
%td= @export.total_mutes
|
||||||
|
%td= table_link_to 'download', t('exports.csv'), settings_exports_mutes_path(format: :csv)
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
(function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var ready = function(loaded) {
|
||||||
|
if (['interactive', 'complete'].indexOf(document.readyState) !== -1) {
|
||||||
|
loaded();
|
||||||
|
} else {
|
||||||
|
document.addEventListener('DOMContentLoaded', loaded);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
ready(function() {
|
||||||
|
var iframes = [];
|
||||||
|
|
||||||
|
window.addEventListener('message', function(e) {
|
||||||
|
var data = e.data || {};
|
||||||
|
|
||||||
|
if (data.type !== 'setHeight' || !iframes[data.id]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
iframes[data.id].height = data.height;
|
||||||
|
});
|
||||||
|
|
||||||
|
[].forEach.call(document.querySelectorAll('iframe.mastodon-embed'), function(iframe) {
|
||||||
|
iframe.scrolling = 'no';
|
||||||
|
iframe.style.overflow = 'hidden';
|
||||||
|
|
||||||
|
iframes.push(iframe);
|
||||||
|
|
||||||
|
var id = iframes.length - 1;
|
||||||
|
|
||||||
|
iframe.onload = function() {
|
||||||
|
iframe.contentWindow.postMessage({
|
||||||
|
type: 'setHeight',
|
||||||
|
id: id,
|
||||||
|
}, '*');
|
||||||
|
};
|
||||||
|
|
||||||
|
iframe.onload();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})();
|
Loading…
Reference in new issue