diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index f2f70e1300c8c3..abf4295585bf89 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -16,7 +16,6 @@ linters: exclude: - 'app/views/admin/accounts/_buttons.html.haml' - 'app/views/admin/accounts/_local_account.html.haml' - - 'app/views/admin/accounts/index.html.haml' - 'app/views/admin/roles/_form.html.haml' - 'app/views/home/index.html.haml' - 'app/views/layouts/application.html.haml' diff --git a/app/controllers/admin/account_actions_controller.rb b/app/controllers/admin/account_actions_controller.rb index e89404b6098e0f..e674bf55a028b0 100644 --- a/app/controllers/admin/account_actions_controller.rb +++ b/app/controllers/admin/account_actions_controller.rb @@ -21,7 +21,7 @@ def create account_action.save! if account_action.with_report? - redirect_to admin_reports_path, notice: I18n.t('admin.reports.processed_msg', id: params[:report_id]) + redirect_to admin_reports_path, notice: I18n.t('admin.reports.processed_msg', id: resource_params[:report_id]) else redirect_to admin_account_path(@account.id) end diff --git a/app/javascript/mastodon/components/column_back_button.jsx b/app/javascript/mastodon/components/column_back_button.jsx deleted file mode 100644 index 3e914ecaddeeb6..00000000000000 --- a/app/javascript/mastodon/components/column_back_button.jsx +++ /dev/null @@ -1,65 +0,0 @@ -import PropTypes from 'prop-types'; -import { PureComponent } from 'react'; -import { createPortal } from 'react-dom'; - -import { FormattedMessage } from 'react-intl'; - -import { withRouter } from 'react-router-dom'; - -import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg'; - -import { Icon } from 'mastodon/components/icon'; -import { WithRouterPropTypes } from 'mastodon/utils/react_router'; - -export class ColumnBackButton extends PureComponent { - - static propTypes = { - multiColumn: PropTypes.bool, - onClick: PropTypes.func, - ...WithRouterPropTypes, - }; - - handleClick = () => { - const { onClick, history } = this.props; - - if (onClick) { - onClick(); - } else if (history.location?.state?.fromMastodon) { - history.goBack(); - } else { - history.push('/'); - } - }; - - render () { - const { multiColumn } = this.props; - - const component = ( - - ); - - if (multiColumn) { - return component; - } else { - // The portal container and the component may be rendered to the DOM in - // the same React render pass, so the container might not be available at - // the time `render()` is called. - const container = document.getElementById('tabs-bar__portal'); - if (container === null) { - // The container wasn't available, force a re-render so that the - // component can eventually be inserted in the container and not scroll - // with the rest of the area. - this.forceUpdate(); - return component; - } else { - return createPortal(component, container); - } - } - } - -} - -export default withRouter(ColumnBackButton); diff --git a/app/javascript/mastodon/components/column_back_button.tsx b/app/javascript/mastodon/components/column_back_button.tsx new file mode 100644 index 00000000000000..965edc8dcd0af1 --- /dev/null +++ b/app/javascript/mastodon/components/column_back_button.tsx @@ -0,0 +1,70 @@ +import { useCallback } from 'react'; + +import { FormattedMessage } from 'react-intl'; + +import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg'; + +import { Icon } from 'mastodon/components/icon'; +import { ButtonInTabsBar } from 'mastodon/features/ui/util/columns_context'; + +import { useAppHistory } from './router'; + +type OnClickCallback = () => void; + +function useHandleClick(onClick?: OnClickCallback) { + const history = useAppHistory(); + + return useCallback(() => { + if (onClick) { + onClick(); + } else if (history.location.state?.fromMastodon) { + history.goBack(); + } else { + history.push('/'); + } + }, [history, onClick]); +} + +export const ColumnBackButton: React.FC<{ onClick: OnClickCallback }> = ({ + onClick, +}) => { + const handleClick = useHandleClick(onClick); + + const component = ( + + ); + + return {component}; +}; + +export const ColumnBackButtonSlim: React.FC<{ onClick: OnClickCallback }> = ({ + onClick, +}) => { + const handleClick = useHandleClick(onClick); + + return ( +
+ {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */} +
+ + +
+
+ ); +}; diff --git a/app/javascript/mastodon/components/column_back_button_slim.jsx b/app/javascript/mastodon/components/column_back_button_slim.jsx deleted file mode 100644 index 397e6c6a779d48..00000000000000 --- a/app/javascript/mastodon/components/column_back_button_slim.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import { FormattedMessage } from 'react-intl'; - -import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg'; - -import { Icon } from 'mastodon/components/icon'; - -import { ColumnBackButton } from './column_back_button'; - -export default class ColumnBackButtonSlim extends ColumnBackButton { - render () { - return ( -
-
- - -
-
- ); - } -} diff --git a/app/javascript/mastodon/components/column_header.jsx b/app/javascript/mastodon/components/column_header.jsx index f60b17d9b833e1..c3709f0b717a7a 100644 --- a/app/javascript/mastodon/components/column_header.jsx +++ b/app/javascript/mastodon/components/column_header.jsx @@ -1,6 +1,5 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { createPortal } from 'react-dom'; import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'; @@ -15,6 +14,7 @@ import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/ import { ReactComponent as TuneIcon } from '@material-symbols/svg-600/outlined/tune.svg'; import { Icon } from 'mastodon/components/icon'; +import { ButtonInTabsBar } from 'mastodon/features/ui/util/columns_context'; import { WithRouterPropTypes } from 'mastodon/utils/react_router'; const messages = defineMessages({ @@ -203,22 +203,12 @@ class ColumnHeader extends PureComponent { ); - if (multiColumn || placeholder) { + if (placeholder) { return component; } else { - // The portal container and the component may be rendered to the DOM in - // the same React render pass, so the container might not be available at - // the time `render()` is called. - const container = document.getElementById('tabs-bar__portal'); - if (container === null) { - // The container wasn't available, force a re-render so that the - // component can eventually be inserted in the container and not scroll - // with the rest of the area. - this.forceUpdate(); - return component; - } else { - return createPortal(component, container); - } + return ( + {component} + ); } } diff --git a/app/javascript/mastodon/components/router.tsx b/app/javascript/mastodon/components/router.tsx index e3815716761782..fe50fc2ba9014e 100644 --- a/app/javascript/mastodon/components/router.tsx +++ b/app/javascript/mastodon/components/router.tsx @@ -1,7 +1,7 @@ import type { PropsWithChildren } from 'react'; import React from 'react'; -import { Router as OriginalRouter } from 'react-router'; +import { Router as OriginalRouter, useHistory } from 'react-router'; import type { LocationDescriptor, @@ -16,18 +16,23 @@ interface MastodonLocationState { fromMastodon?: boolean; mastodonModalKey?: string; } -type HistoryPath = Path | LocationDescriptor; -const browserHistory = createBrowserHistory< - MastodonLocationState | undefined ->(); +type LocationState = MastodonLocationState | null | undefined; + +type HistoryPath = Path | LocationDescriptor; + +const browserHistory = createBrowserHistory(); const originalPush = browserHistory.push.bind(browserHistory); const originalReplace = browserHistory.replace.bind(browserHistory); +export function useAppHistory() { + return useHistory(); +} + function normalizePath( path: HistoryPath, - state?: MastodonLocationState, -): LocationDescriptorObject { + state?: LocationState, +): LocationDescriptorObject { const location = typeof path === 'string' ? { pathname: path } : { ...path }; if (location.state === undefined && state !== undefined) { diff --git a/app/javascript/mastodon/features/account_gallery/index.jsx b/app/javascript/mastodon/features/account_gallery/index.jsx index 19c10fa9f8b98a..6a1d0b322fd1bf 100644 --- a/app/javascript/mastodon/features/account_gallery/index.jsx +++ b/app/javascript/mastodon/features/account_gallery/index.jsx @@ -8,7 +8,7 @@ import { connect } from 'react-redux'; import { lookupAccount, fetchAccount } from 'mastodon/actions/accounts'; import { openModal } from 'mastodon/actions/modal'; -import ColumnBackButton from 'mastodon/components/column_back_button'; +import { ColumnBackButton } from 'mastodon/components/column_back_button'; import { LoadMore } from 'mastodon/components/load_more'; import { LoadingIndicator } from 'mastodon/components/loading_indicator'; import ScrollContainer from 'mastodon/containers/scroll_container'; @@ -203,7 +203,7 @@ class AccountGallery extends ImmutablePureComponent { return ( - +
diff --git a/app/javascript/mastodon/features/account_timeline/index.jsx b/app/javascript/mastodon/features/account_timeline/index.jsx index 0f18c043b81101..5dae66b46365b0 100644 --- a/app/javascript/mastodon/features/account_timeline/index.jsx +++ b/app/javascript/mastodon/features/account_timeline/index.jsx @@ -16,7 +16,7 @@ import { getAccountHidden } from 'mastodon/selectors'; import { lookupAccount, fetchAccount } from '../../actions/accounts'; import { fetchFeaturedTags } from '../../actions/featured_tags'; import { expandAccountFeaturedTimeline, expandAccountTimeline, connectTimeline, disconnectTimeline } from '../../actions/timelines'; -import ColumnBackButton from '../../components/column_back_button'; +import { ColumnBackButton } from '../../components/column_back_button'; import { LoadingIndicator } from '../../components/loading_indicator'; import StatusList from '../../components/status_list'; import Column from '../ui/components/column'; @@ -184,7 +184,7 @@ class AccountTimeline extends ImmutablePureComponent { return ( - + } diff --git a/app/javascript/mastodon/features/blocks/index.jsx b/app/javascript/mastodon/features/blocks/index.jsx index 210260c8112bf7..21b7a263f18f90 100644 --- a/app/javascript/mastodon/features/blocks/index.jsx +++ b/app/javascript/mastodon/features/blocks/index.jsx @@ -10,7 +10,7 @@ import { ReactComponent as BlockIcon } from '@material-symbols/svg-600/outlined/ import { debounce } from 'lodash'; import { fetchBlocks, expandBlocks } from '../../actions/blocks'; -import ColumnBackButtonSlim from '../../components/column_back_button_slim'; +import { ColumnBackButtonSlim } from '../../components/column_back_button'; import { LoadingIndicator } from '../../components/loading_indicator'; import ScrollableList from '../../components/scrollable_list'; import AccountContainer from '../../containers/account_container'; diff --git a/app/javascript/mastodon/features/domain_blocks/index.jsx b/app/javascript/mastodon/features/domain_blocks/index.jsx index 5ac1d2a71e44b0..958083d588929c 100644 --- a/app/javascript/mastodon/features/domain_blocks/index.jsx +++ b/app/javascript/mastodon/features/domain_blocks/index.jsx @@ -12,7 +12,7 @@ import { ReactComponent as BlockIcon } from '@material-symbols/svg-600/outlined/ import { debounce } from 'lodash'; import { fetchDomainBlocks, expandDomainBlocks } from '../../actions/domain_blocks'; -import ColumnBackButtonSlim from '../../components/column_back_button_slim'; +import { ColumnBackButtonSlim } from '../../components/column_back_button'; import { LoadingIndicator } from '../../components/loading_indicator'; import ScrollableList from '../../components/scrollable_list'; import DomainContainer from '../../containers/domain_container'; diff --git a/app/javascript/mastodon/features/follow_requests/index.jsx b/app/javascript/mastodon/features/follow_requests/index.jsx index 8e17607fd9cf10..7d8785e052bca6 100644 --- a/app/javascript/mastodon/features/follow_requests/index.jsx +++ b/app/javascript/mastodon/features/follow_requests/index.jsx @@ -12,7 +12,7 @@ import { ReactComponent as PersonAddIcon } from '@material-symbols/svg-600/outli import { debounce } from 'lodash'; import { fetchFollowRequests, expandFollowRequests } from '../../actions/accounts'; -import ColumnBackButtonSlim from '../../components/column_back_button_slim'; +import { ColumnBackButtonSlim } from '../../components/column_back_button'; import ScrollableList from '../../components/scrollable_list'; import { me } from '../../initial_state'; import Column from '../ui/components/column'; diff --git a/app/javascript/mastodon/features/followers/index.jsx b/app/javascript/mastodon/features/followers/index.jsx index ec393955188373..fc0ce8ab30119b 100644 --- a/app/javascript/mastodon/features/followers/index.jsx +++ b/app/javascript/mastodon/features/followers/index.jsx @@ -19,7 +19,7 @@ import { fetchFollowers, expandFollowers, } from '../../actions/accounts'; -import ColumnBackButton from '../../components/column_back_button'; +import { ColumnBackButton } from '../../components/column_back_button'; import { LoadingIndicator } from '../../components/loading_indicator'; import ScrollableList from '../../components/scrollable_list'; import AccountContainer from '../../containers/account_container'; @@ -147,7 +147,7 @@ class Followers extends ImmutablePureComponent { return ( - + - + - +
diff --git a/app/javascript/mastodon/features/onboarding/index.jsx b/app/javascript/mastodon/features/onboarding/index.jsx index c3e6fd6158a054..96bc15481e1d6b 100644 --- a/app/javascript/mastodon/features/onboarding/index.jsx +++ b/app/javascript/mastodon/features/onboarding/index.jsx @@ -47,7 +47,6 @@ class Onboarding extends ImmutablePureComponent { static propTypes = { dispatch: PropTypes.func.isRequired, account: ImmutablePropTypes.map, - multiColumn: PropTypes.bool, ...WithRouterPropTypes, }; @@ -100,14 +99,14 @@ class Onboarding extends ImmutablePureComponent { } render () { - const { account, multiColumn } = this.props; + const { account } = this.props; const { step, shareClicked } = this.state; switch(step) { case 'follows': - return ; + return ; case 'share': - return ; + return ; } return ( diff --git a/app/javascript/mastodon/features/onboarding/share.jsx b/app/javascript/mastodon/features/onboarding/share.jsx index c9d58c4e651658..8e01701eb3f394 100644 --- a/app/javascript/mastodon/features/onboarding/share.jsx +++ b/app/javascript/mastodon/features/onboarding/share.jsx @@ -14,7 +14,7 @@ import { ReactComponent as ContentCopyIcon } from '@material-symbols/svg-600/out import SwipeableViews from 'react-swipeable-views'; import Column from 'mastodon/components/column'; -import ColumnBackButton from 'mastodon/components/column_back_button'; +import { ColumnBackButton } from 'mastodon/components/column_back_button'; import { Icon } from 'mastodon/components/icon'; import { me, domain } from 'mastodon/initial_state'; @@ -146,18 +146,17 @@ class Share extends PureComponent { static propTypes = { onBack: PropTypes.func, account: ImmutablePropTypes.map, - multiColumn: PropTypes.bool, intl: PropTypes.object, }; render () { - const { onBack, account, multiColumn, intl } = this.props; + const { onBack, account, intl } = this.props; const url = (new URL(`/@${account.get('username')}`, document.baseURI)).href; return ( - +
diff --git a/app/javascript/mastodon/features/pinned_statuses/index.jsx b/app/javascript/mastodon/features/pinned_statuses/index.jsx index 57d9768bed0adb..e8206d704c822e 100644 --- a/app/javascript/mastodon/features/pinned_statuses/index.jsx +++ b/app/javascript/mastodon/features/pinned_statuses/index.jsx @@ -13,7 +13,7 @@ import { ReactComponent as PushPinIcon } from '@material-symbols/svg-600/outline import { getStatusList } from 'mastodon/selectors'; import { fetchPinnedStatuses } from '../../actions/pin_statuses'; -import ColumnBackButtonSlim from '../../components/column_back_button_slim'; +import { ColumnBackButtonSlim } from '../../components/column_back_button'; import StatusList from '../../components/status_list'; import Column from '../ui/components/column'; diff --git a/app/javascript/mastodon/features/status/components/card.jsx b/app/javascript/mastodon/features/status/components/card.jsx index efd57c8716d3d2..684c599adb0d55 100644 --- a/app/javascript/mastodon/features/status/components/card.jsx +++ b/app/javascript/mastodon/features/status/components/card.jsx @@ -143,7 +143,7 @@ export default class Card extends PureComponent { {card.get('title')} - {card.get('author_name').length > 0 ? {card.get('author_name')} }} /> : {card.get('description')}} + {card.get('author_name').length > 0 ? {card.get('author_name')} }} /> : {card.get('description')}}
); diff --git a/app/javascript/mastodon/features/ui/components/columns_area.jsx b/app/javascript/mastodon/features/ui/components/columns_area.jsx index 8f17c8df76fe61..2e6c4a63edc5b0 100644 --- a/app/javascript/mastodon/features/ui/components/columns_area.jsx +++ b/app/javascript/mastodon/features/ui/components/columns_area.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import { Children, cloneElement } from 'react'; +import { Children, cloneElement, useCallback } from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -26,6 +26,7 @@ import { AntennaTimeline, CircleStatuses, } from '../util/async-components'; +import { useColumnsContext } from '../util/columns_context'; import BundleColumnError from './bundle_column_error'; import { ColumnLoading } from './column_loading'; @@ -53,6 +54,17 @@ const componentMap = { 'DIRECTORY': Directory, }; +const TabsBarPortal = () => { + const {setTabsBarElement} = useColumnsContext(); + + const setRef = useCallback((element) => { + if(element) + setTabsBarElement(element); + }, [setTabsBarElement]); + + return
; +}; + export default class ColumnsArea extends ImmutablePureComponent { static propTypes = { columns: ImmutablePropTypes.list.isRequired, @@ -156,7 +168,7 @@ export default class ColumnsArea extends ImmutablePureComponent {
-
+
{children}
diff --git a/app/javascript/mastodon/features/ui/index.jsx b/app/javascript/mastodon/features/ui/index.jsx index 7312f89c24690c..23c7ccd0081382 100644 --- a/app/javascript/mastodon/features/ui/index.jsx +++ b/app/javascript/mastodon/features/ui/index.jsx @@ -77,8 +77,8 @@ import { PrivacyPolicy, CommunityTimeline, } from './util/async-components'; +import { ColumnsContextProvider } from './util/columns_context'; import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers'; - // Dummy import, to make sure that ends up in the application bundle. // Without this it ends up in ~8 very commonly used bundles. import '../../components/status'; @@ -193,84 +193,86 @@ class SwitchingColumnsArea extends PureComponent { } return ( - - - {redirect} - - {singleColumn ? : null} - {singleColumn && pathName.startsWith('/deck/') ? : null} - {/* Redirect old bookmarks (without /deck) with home-like routes to the advanced interface */} - {!singleColumn && pathName === '/getting-started' ? : null} - {!singleColumn && pathName === '/home' ? : null} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {/* Legacy routes, cannot be easily factored with other routes because they share a param name */} - - - - - - - - - - - - - - - - - - - - - + + + + {redirect} + + {singleColumn ? : null} + {singleColumn && pathName.startsWith('/deck/') ? : null} + {/* Redirect old bookmarks (without /deck) with home-like routes to the advanced interface */} + {!singleColumn && pathName === '/getting-started' ? : null} + {!singleColumn && pathName === '/home' ? : null} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {/* Legacy routes, cannot be easily factored with other routes because they share a param name */} + + + + + + + + + + + + + + + + + + + + + + ); } diff --git a/app/javascript/mastodon/features/ui/util/columns_context.tsx b/app/javascript/mastodon/features/ui/util/columns_context.tsx new file mode 100644 index 00000000000000..e02918deb00d07 --- /dev/null +++ b/app/javascript/mastodon/features/ui/util/columns_context.tsx @@ -0,0 +1,51 @@ +import type { ReactElement } from 'react'; +import { createContext, useContext, useMemo, useState } from 'react'; +import { createPortal } from 'react-dom'; + +export const ColumnsContext = createContext<{ + tabsBarElement: HTMLElement | null; + setTabsBarElement: (element: HTMLElement) => void; + multiColumn: boolean; +}>({ + tabsBarElement: null, + multiColumn: false, + setTabsBarElement: () => undefined, // no-op +}); + +export function useColumnsContext() { + return useContext(ColumnsContext); +} + +export const ButtonInTabsBar: React.FC<{ + children: ReactElement | string | undefined; +}> = ({ children }) => { + const { multiColumn, tabsBarElement } = useColumnsContext(); + + if (multiColumn) { + return children; + } else if (!tabsBarElement) { + return children; + } else { + return createPortal(children, tabsBarElement); + } +}; + +type ContextValue = React.ContextType; + +export const ColumnsContextProvider: React.FC< + React.PropsWithChildren<{ multiColumn: boolean }> +> = ({ multiColumn, children }) => { + const [tabsBarElement, setTabsBarElement] = + useState(null); + + const contextValue = useMemo( + () => ({ multiColumn, tabsBarElement, setTabsBarElement }), + [multiColumn, tabsBarElement], + ); + + return ( + + {children} + + ); +}; diff --git a/app/javascript/mastodon/locales/fi.json b/app/javascript/mastodon/locales/fi.json index aac4256ffdbf96..c4dbbc5f0310bc 100644 --- a/app/javascript/mastodon/locales/fi.json +++ b/app/javascript/mastodon/locales/fi.json @@ -1,5 +1,5 @@ { - "about.blocks": "Valvotut palvelimet", + "about.blocks": "Moderoidut palvelimet", "about.contact": "Ota yhteyttä:", "about.disclaimer": "Mastodon on vapaa avoimen lähdekoodin ohjelmisto ja Mastodon gGmbH:n tavaramerkki.", "about.domain_blocks.no_reason_available": "Syytä ei ole ilmoitettu", diff --git a/app/javascript/mastodon/locales/gl.json b/app/javascript/mastodon/locales/gl.json index b5d9e50f65717c..8431d12acc1d0b 100644 --- a/app/javascript/mastodon/locales/gl.json +++ b/app/javascript/mastodon/locales/gl.json @@ -20,7 +20,7 @@ "account.block_short": "Bloquear", "account.blocked": "Bloqueada", "account.browse_more_on_origin_server": "Busca máis no perfil orixinal", - "account.cancel_follow_request": "Retirar solicitude de seguimento", + "account.cancel_follow_request": "Cancelar a solicitude de seguimento", "account.direct": "Mencionar de xeito privado a @{name}", "account.disable_notifications": "Deixar de notificarme cando @{name} publica", "account.domain_blocked": "Dominio agochado", diff --git a/app/javascript/mastodon/locales/ko.json b/app/javascript/mastodon/locales/ko.json index ccd783e8092208..3a78a9cd791e70 100644 --- a/app/javascript/mastodon/locales/ko.json +++ b/app/javascript/mastodon/locales/ko.json @@ -590,7 +590,7 @@ "search.quick_action.open_url": "마스토돈에서 URL 열기", "search.quick_action.status_search": "{x}에 맞는 게시물", "search.search_or_paste": "검색하거나 URL 붙여넣기", - "search_popout.full_text_search_disabled_message": "{domain}에서는 사용할 수 없습니다.", + "search_popout.full_text_search_disabled_message": "{domain}에서는 이용할 수 없습니다.", "search_popout.language_code": "ISO 언어코드", "search_popout.options": "검색 옵션", "search_popout.quick_actions": "빠른 작업", diff --git a/app/javascript/mastodon/locales/pl.json b/app/javascript/mastodon/locales/pl.json index 814a14c15618f9..84ea64bb986643 100644 --- a/app/javascript/mastodon/locales/pl.json +++ b/app/javascript/mastodon/locales/pl.json @@ -81,7 +81,7 @@ "admin.impact_report.instance_follows": "Obserwujący, których straciliby ich użytkownicy", "admin.impact_report.title": "Podsumowanie wpływu", "alert.rate_limited.message": "Spróbuj ponownie po {retry_time, time, medium}.", - "alert.rate_limited.title": "Ograniczony czasowo", + "alert.rate_limited.title": "Ograniczenie liczby zapytań", "alert.unexpected.message": "Wystąpił nieoczekiwany błąd.", "alert.unexpected.title": "Ups!", "announcement.announcement": "Ogłoszenie", diff --git a/app/lib/attachment_batch.rb b/app/lib/attachment_batch.rb index 78bd5931603535..13a9da828f5cf2 100644 --- a/app/lib/attachment_batch.rb +++ b/app/lib/attachment_batch.rb @@ -75,7 +75,12 @@ def remove_files end when :fog logger.debug { "Deleting #{attachment.path(style)}" } - attachment.send(:directory).files.new(key: attachment.path(style)).destroy + + begin + attachment.send(:directory).files.new(key: attachment.path(style)).destroy + rescue Fog::Storage::OpenStack::NotFound + # Ignore failure to delete a file that has already been deleted + end when :azure logger.debug { "Deleting #{attachment.path(style)}" } attachment.destroy diff --git a/app/models/user.rb b/app/models/user.rb index 74e6baa3d1da7f..ab988360d51408 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -490,7 +490,7 @@ def needs_feed_update? end def validate_email_dns? - email_changed? && !external? && !(Rails.env.test? || Rails.env.development?) + email_changed? && !external? && !Rails.env.local? # rubocop:disable Rails/UnknownEnv end def validate_role_elevation diff --git a/app/views/admin/accounts/index.html.haml b/app/views/admin/accounts/index.html.haml index da11e4361c2d13..9cec8d6325c87a 100644 --- a/app/views/admin/accounts/index.html.haml +++ b/app/views/admin/accounts/index.html.haml @@ -22,9 +22,10 @@ .fields-group - %i(username by_domain display_name email ip).each do |key| - - unless key == :by_domain && params[:origin] != 'remote' - .input.string.optional - = text_field_tag key, params[key], class: 'string optional', placeholder: I18n.t("admin.accounts.#{key}") + - next if key == :by_domain && params[:origin] != 'remote' + + .input.string.optional + = text_field_tag key, params[key], class: 'string optional', placeholder: I18n.t("admin.accounts.#{key}") .actions %button.button= t('admin.accounts.search') diff --git a/app/views/settings/exports/show.html.haml b/app/views/settings/exports/show.html.haml index d7b59af270a43b..320bb0c7cebcbb 100644 --- a/app/views/settings/exports/show.html.haml +++ b/app/views/settings/exports/show.html.haml @@ -24,14 +24,14 @@ %th= t('admin.accounts.followers') %td= number_with_delimiter @export.total_followers %td - %tr - %th= t('exports.blocks') - %td= number_with_delimiter @export.total_blocks - %td= table_link_to 'download', t('exports.csv'), settings_exports_blocks_path(format: :csv) %tr %th= t('exports.mutes') %td= number_with_delimiter @export.total_mutes %td= table_link_to 'download', t('exports.csv'), settings_exports_mutes_path(format: :csv) + %tr + %th= t('exports.blocks') + %td= number_with_delimiter @export.total_blocks + %td= table_link_to 'download', t('exports.csv'), settings_exports_blocks_path(format: :csv) %tr %th= t('exports.domain_blocks') %td= number_with_delimiter @export.total_domain_blocks diff --git a/config/application.rb b/config/application.rb index 7f7f8b5d6cc8be..ad931fd36bcce6 100644 --- a/config/application.rb +++ b/config/application.rb @@ -206,7 +206,7 @@ class Application < Rails::Application # We use our own middleware for this config.public_file_server.enabled = false - config.middleware.use PublicFileServerMiddleware if Rails.env.development? || Rails.env.test? || ENV['RAILS_SERVE_STATIC_FILES'] == 'true' + config.middleware.use PublicFileServerMiddleware if Rails.env.local? || ENV['RAILS_SERVE_STATIC_FILES'] == 'true' # rubocop:disable Rails/UnknownEnv config.middleware.use Rack::Attack config.middleware.use Mastodon::RackMiddleware diff --git a/config/initializers/strong_migrations.rb b/config/initializers/strong_migrations.rb index 10b3805db240ec..4dcec1c2a29b76 100644 --- a/config/initializers/strong_migrations.rb +++ b/config/initializers/strong_migrations.rb @@ -1,4 +1,4 @@ # frozen_string_literal: true StrongMigrations.start_after = 2017_09_24_022025 -StrongMigrations.target_version = 10 +StrongMigrations.target_version = 12 diff --git a/config/locales/cy.yml b/config/locales/cy.yml index 09e201f55a957d..baa6d31e3580ba 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -1174,6 +1174,7 @@ cy: functional: Mae eich cyfrif nawr yn weithredol. pending: Mae'ch cais yn aros i gael ei adolygu gan ein staff. Gall hyn gymryd cryn amser. Byddwch yn derbyn e-bost os caiff eich cais ei gymeradwyo. redirecting_to: Mae eich cyfrif yn anweithredol oherwydd ei fod ar hyn o bryd yn ailgyfeirio i %{acct}. + self_destruct: Gab fod parth %{domain} yn cau, dim ond mynediad cyfyngedig fyddwch yn ei gael i'ch cyfrif. view_strikes: Gweld rybuddion y gorffennol yn erbyn eich cyfrif too_fast: Cafodd y ffurflen ei chyflwyno'n rhy gyflym, ceisiwch eto. use_security_key: Defnyddiwch allwedd diogelwch @@ -1675,6 +1676,9 @@ cy: over_daily_limit: Rydych wedi mynd dros y terfyn o %{limit} postiad a drefnwyd ar gyfer heddiw over_total_limit: Rydych wedi mynd dros y terfyn o %{limit} postiad a drefnwyd too_soon: Rhaid i'r dyddiad a drefnwyd fod yn y dyfodol + self_destruct: + lead_html: Yn anffodus mae %{domain} yn cau'n barhaol. Os oedd gennych gyfrif yno, ni fydd modd i chi barhau i'w ddefnyddio, ond mae dal modd gofyn i gael copi wrth gefn o'ch data. + title: Mae'r gweinydd hwn yn cau sessions: activity: Gweithgaredd ddiwethaf browser: Porwr diff --git a/config/locales/da.yml b/config/locales/da.yml index 9ffece04d70007..c5d63918531f84 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -1041,6 +1041,14 @@ da: hint_html: Bare en ting mere! Vi er nødt til at bekræfte, at du er et menneske (dette er for at vi kan holde spam ude!). Løs CAPTCHA'en nedenfor og klik på "Fortsæt". title: Sikkerhedstjek confirmations: + awaiting_review: E-mailadressen er bekræftet! %{domain}-personalet gennemgår nu registreringen. En e-mail fremsendes, såfremt din konto godkendes! + awaiting_review_title: Registreringen er ved at blive gennemgået + clicking_this_link: klikke på dette link + login_link: log ind + proceed_to_login_html: Der kan nu fortsættes til %{login_link}. + redirect_to_app_html: En omdirigering til %{app_name}-appen burde være sket. Er det ikke tilfældet, prøv da %{clicking_this_link} eller returnér manuelt til appen. + registration_complete: Registreringen på %{domain} er nu fuldført! + welcome_title: Velkommen %{name}! wrong_email_hint: Er denne e-mailadresse ikke korrekt, kan den ændres i kontoindstillinger. delete_account: Slet konto delete_account_html: Ønsker du at slette din konto, kan du gøre dette hér. Du vil blive bedt om bekræftelse. diff --git a/config/locales/de.yml b/config/locales/de.yml index c6b3218ee9a160..21dfe4a7fb106e 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1041,6 +1041,12 @@ de: hint_html: Fast geschafft! Wir müssen uns vergewissern, dass du ein Mensch bist (damit wir Spam verhindern können!). Bitte löse das CAPTCHA und klicke auf „Weiter“. title: Sicherheitsüberprüfung confirmations: + awaiting_review: Deine E-Mail-Adresse wurde bestätigt und das Team von %{domain} überprüft nun deine Registrierung. Sobald es dein Konto genehmigt, wirst du eine E-Mail erhalten. + awaiting_review_title: Deine Registrierung wird überprüft + login_link: anmelden + proceed_to_login_html: Du kannst dich nun %{login_link}. + registration_complete: Deine Registrierung auf %{domain} ist nun abgeschlossen! + welcome_title: Willkommen, %{name}! wrong_email_hint: Sollte diese E-Mail-Adresse nicht korrekt sein, kannst du sie in den Kontoeinstellungen ändern. delete_account: Konto löschen delete_account_html: Falls du dein Konto endgültig löschen möchtest, kannst du das hier vornehmen. Du musst dies zusätzlich bestätigen. diff --git a/config/locales/devise.sr-Latn.yml b/config/locales/devise.sr-Latn.yml index 6b4a5801c616e9..40f3d51c30ffb1 100644 --- a/config/locales/devise.sr-Latn.yml +++ b/config/locales/devise.sr-Latn.yml @@ -88,7 +88,7 @@ sr-Latn: updated_not_active: Vaša lozinka nije uspešno promenjena. registrations: destroyed: Ćao! Vaš nalog je uspešno obrisan. Nadamo se da ćete se uskoro vratiti. - signed_up: Dobrodošli! Uspešno ste se registrovali. + signed_up: Dobro došli! Uspešno ste se registrovali. signed_up_but_inactive: Uspešno ste se registrovali. Nažalost ne možete se prijaviti zato što Vaš nalog još nije aktiviran. signed_up_but_locked: Uspešno ste se registrovali. Nažalost ne možete se prijaviti zato što je Vaš nalog zaključan. signed_up_but_pending: Na vaš imejl poslata je poruka sa vezom za potvrdu. Nakon što kliknete na vezu, pregledaćemo vašu prijavu. Bićete obavešteni ako bude odobreno. diff --git a/config/locales/devise.sr.yml b/config/locales/devise.sr.yml index d55cf7a268e924..f61431de607ddc 100644 --- a/config/locales/devise.sr.yml +++ b/config/locales/devise.sr.yml @@ -88,7 +88,7 @@ sr: updated_not_active: Ваша лозинка није успешно промењена. registrations: destroyed: Ћао! Ваш налог је успешно обрисан. Надамо се да ћете се ускоро вратити. - signed_up: Добродошли! Успешно сте се регистровали. + signed_up: Добро дошли! Успешно сте се регистровали. signed_up_but_inactive: Успешно сте се регистровали. Нажалост не можете се пријавити зато што Ваш налог још није активиран. signed_up_but_locked: Успешно сте се регистровали. Нажалост не можете се пријавити зато што је Ваш налог закључан. signed_up_but_pending: На ваш имејл послата је порука са везом за потврду. Након што кликнете на везу, прегледаћемо вашу пријаву. Бићете обавештени ако буде одобрено. diff --git a/config/locales/es-MX.yml b/config/locales/es-MX.yml index e055ff4c799f63..ad2fb184ea229b 100644 --- a/config/locales/es-MX.yml +++ b/config/locales/es-MX.yml @@ -1041,6 +1041,14 @@ es-MX: hint_html: ¡Una última cosita! Necesitamos confirmar que eres humano (¡así podemos evitar el spam!). Resuelve este CAPTCHA de debajo y pulsa en "Continuar". title: Comprobación de seguridad confirmations: + awaiting_review: "¡Tu dirección de correo electrónico ha sido confirmada! El personal de %{domain} está revisando tu registro. ¡Recibirás un correo electrónico si aprueban tu cuenta!" + awaiting_review_title: Su registro está siendo revisado + clicking_this_link: presionando este enlace + login_link: iniciar sesión + proceed_to_login_html: Ahora puedes proceder a %{login_link}. + redirect_to_app_html: Deberías haber sido redirigido a la aplicación %{app_name}. Si eso no sucedió, prueba %{clicking_this_link} o vuelve a la aplicación manualmente. + registration_complete: "¡Tu registro en %{domain} ha sido completado!" + welcome_title: "¡Bienvenido, %{name}!" wrong_email_hint: Si esa dirección de correo electrónico no es correcta, puedes cambiarla en la configuración de la cuenta. delete_account: Borrar cuenta delete_account_html: Si desea eliminar su cuenta, puede proceder aquí. Será pedido de una confirmación. diff --git a/config/locales/fi.yml b/config/locales/fi.yml index c8c17b853a11ef..4b4585f690beae 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1041,6 +1041,14 @@ fi: hint_html: Vielä yksi juttu! Meidän on vahvistettava, että olet ihminen (tämän avulla pidämme roskapostin poissa!). Ratkaise alla oleva CAPTCHA-vahvistus ja paina "Jatka". title: Turvatarkastus confirmations: + awaiting_review: Sähköpostiosoitteesi on vahvistettu! Palvelun %{domain} ylläpito tarkistaa nyt rekisteröitymisesi. Saat sähköpostiviestin, jos tilisi hyväksytään! + awaiting_review_title: Rekisteröitymisesi on tarkistettavana + clicking_this_link: napsauttaa tätä linkkiä + login_link: kirjautumalla sisään + proceed_to_login_html: Voit nyt jatkaa %{login_link}. + redirect_to_app_html: Sinun olisi pitänyt ohjautua sovellukseen %{app_name}. Jos näin ei tapahtunut, kokeile %{clicking_this_link} tai palaa sovellukseen manuaalisesti. + registration_complete: Rekisteröitymisesi palveluun %{domain} on nyt valmis! + welcome_title: Tervetuloa, %{name}! wrong_email_hint: Jos sähköpostiosoite ei ole oikein, voit muuttaa sen tilin asetuksista. delete_account: Poista tili delete_account_html: Jos haluat poistaa tilisi, voit edetä tästä. Sinua pyydetään vahvistamaan poisto. @@ -1100,7 +1108,7 @@ fi: account_status: Tilin tila confirming: Odotetaan sähköpostivahvistuksen valmistumista. functional: Tilisi on täysin toiminnassa. - pending: Hakemuksesi odottaa henkilökuntamme tarkastusta. Tämä voi kestää jonkin aikaa. Saat sähköpostiviestin, jos hakemuksesi hyväksytään. + pending: Hakemuksesi odottaa palvelimen ylläpidon tarkastusta. Tämä voi kestää jonkin aikaa. Saat sähköpostiviestin, jos hakemuksesi hyväksytään. redirecting_to: Tilisi ei ole aktiivinen, koska se ohjaa tällä hetkellä tilille %{acct}. self_destruct: Koska %{domain} sulkeutuu, voit käyttää tiliäsi vain rajoitetusti. view_strikes: Näytä tiliäsi koskevia aiempia varoituksia @@ -1163,7 +1171,7 @@ fi: approve_appeal: Hyväksy valitus associated_report: Liittyvä raportti created_at: Päivätty - description_html: Nämä ovat tiliäsi koskevia toimia ja varoituksia, jotka instanssin %{instance} henkilökunta on lähettänyt sinulle. + description_html: Nämä ovat tiliäsi koskevia toimia ja varoituksia, jotka instanssin %{instance} ylläpito on lähettänyt sinulle. recipient: Osoitettu reject_appeal: Hylkää valitus status: 'Julkaisu #%{id}' @@ -1786,7 +1794,7 @@ fi: title: Uusi kirjautuminen warning: appeal: Lähetä valitus - appeal_description: Jos uskot, että tämä on virhe, voit hakea muutosta instanssin %{instance} henkilökunnalta. + appeal_description: Jos uskot, että tämä on virhe, voit hakea muutosta instanssin %{instance} ylläpidolta. categories: spam: Roskaposti violation: Sisältö rikkoo seuraavia yhteisön sääntöjä diff --git a/config/locales/gl.yml b/config/locales/gl.yml index f76c4dda12f1a2..525532ed98bbcc 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -1041,6 +1041,14 @@ gl: hint_html: Unha cousa máis! Temos que confirmar que es un ser humano (para poder evitar contas de spam!). Resolve o CAPTCHA de aquí embaixo e preme en "Continuar". title: Comprobación de seguridade confirmations: + awaiting_review: O teu correo está verificado! A administración de %{domain} está revisando a túa solicitude. Recibirás outro correo se aproban a túa conta! + awaiting_review_title: Estamos revisando a solicitude de rexistro + clicking_this_link: premendo nesta ligazón + login_link: acceder + proceed_to_login_html: Xa podes %{login_link}. + redirect_to_app_html: Ímoste redirixir á app %{app_name}. Se iso non acontece, proba %{clicking_this_link} ou volve ti manualmente á app. + registration_complete: Completouse a creación da conta en %{domain}! + welcome_title: Benvida, %{name}! wrong_email_hint: Se o enderezo de email non é correcto, podes cambialo nos axustes da conta. delete_account: Eliminar conta delete_account_html: Se queres eliminar a túa conta, podes facelo aquí. Deberás confirmar a acción. diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 67f5b693ac8e1c..9d08786428349e 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -1041,6 +1041,14 @@ hu: hint_html: Még egy dolog! Meg kell győződnünk róla, hogy tényleg valós személy vagy (így távol tarthatjuk a spam-et). Oldd meg az alábbi CAPTCHA-t és kattints a "Folytatás"-ra. title: Biztonsági ellenőrzés confirmations: + awaiting_review: Az email cím megerősítésre került. %{domain} stáb elenleg áttrkinti a regisztrációt. Ha jóváhagyásra kerül a fiók, egy email kerül kiküldésre! + awaiting_review_title: A regisztráció áttekintés alatt áll. + clicking_this_link: kattintás erre a hivatkozásra + login_link: bejelentkezés + proceed_to_login_html: 'Most továbbléphetünk: %{login_link}.' + redirect_to_app_html: Át kellett volna kerülni %{app_name} alkalmazáshoz. Ha ez nem történt meg, próbálkozzunk %{clicking_this_link} lehetőséggel vagy térjünk vissza manuálisan az alkalmazáshoz. + registration_complete: A regisztráció %{domain} domainen befejeződött! + welcome_title: Üdvözlet, %{name}! wrong_email_hint: Ha az emailcím nem helyes, a fiókbeállításokban megváltoztathatod. delete_account: Felhasználói fiók törlése delete_account_html: Felhasználói fiókod törléséhez kattints ide. A rendszer újbóli megerősítést fog kérni. diff --git a/config/locales/is.yml b/config/locales/is.yml index f5d89eca66c91e..a229f0af027844 100644 --- a/config/locales/is.yml +++ b/config/locales/is.yml @@ -1045,6 +1045,10 @@ is: Leystu Turing skynprófið og smelltu á "Áfram". title: Öryggisathugun confirmations: + clicking_this_link: smella á þennan tengil + login_link: skrá þig inn + proceed_to_login_html: Þú getur núna farið í að %{login_link}. + welcome_title: Velkomin/n %{name}! wrong_email_hint: Ef það tölvupóstfang er ekki rétt geturðu breytt því í stillingum notandaaðgangsins. delete_account: Eyða notandaaðgangi delete_account_html: Ef þú vilt eyða notandaaðgangnum þínum, þá geturðu farið í það hér. Þú verður beðin/n um staðfestingu. diff --git a/config/locales/ja.yml b/config/locales/ja.yml index af8a2c30dc7734..0fdc776462fdd8 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1219,6 +1219,14 @@ ja: title: セキュリティチェック cloudflare_with_registering: 登録時にCloudflareの画面が表示されます。登録できないときは管理者へご連絡ください confirmations: + awaiting_review: メールアドレスは確認済みです。%{domain} のモデレーターによりアカウント登録の審査が完了すると、メールでお知らせします。 + awaiting_review_title: 登録の審査待ちです + clicking_this_link: こちらのリンク + login_link: こちらのリンク + proceed_to_login_html: "%{login_link}から早速ログインしてみましょう。" + redirect_to_app_html: "%{app_name}に戻ります。自動で移動しない場合は%{clicking_this_link}を押すか、手動でアプリを切り替えてください。" + registration_complete: "%{domain} へのアカウント登録が完了しました。" + welcome_title: Mastodonへようこそ、%{name}さん wrong_email_hint: メールアドレスが正しくない場合は、アカウント設定で変更できます。 delete_account: アカウントの削除 delete_account_html: アカウントを削除したい場合、こちらから手続きが行えます。削除する前に、確認画面があります。 diff --git a/config/locales/ko.yml b/config/locales/ko.yml index eecac963e00f7a..1bcc8853e56951 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -1025,6 +1025,14 @@ ko: hint_html: 하나만 더! 당신이 사람인지 확인이 필요합니다 (스팸 계정을 거르기 위해서 필요한 과정입니다). 아래에 있는 CAPTCHA를 풀고 "계속"을 누르세요 title: 보안 체크 confirmations: + awaiting_review: 이메일 주소를 확인했어요! 이제 %{domain} 스태프가 가입을 검토해요. 계정이 승인되면 이메일을 보내드려요. + awaiting_review_title: 가입 검토 중 + clicking_this_link: 이 링크를 클릭 + login_link: 로그인 + proceed_to_login_html: "%{login_link} 할 수 있게 되었어요." + redirect_to_app_html: 곧 %{app_name}으로 리디렉션 되어요. 안 된다면, %{clicking_this_link}하거나 직접 앱으로 돌아가세요. + registration_complete: 지금 막 %{domain} 가입을 마쳤어요! + welcome_title: "%{name} 님 반가워요!" wrong_email_hint: 만약 이메일 주소가 올바르지 않다면, 계정 설정에서 수정할 수 있습니다. delete_account: 계정 삭제 delete_account_html: 계정을 삭제하고 싶은 경우, 여기서 삭제할 수 있습니다. 삭제 전 확인 화면이 표시됩니다. diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 6e3fe0cd8987d9..f16803fb29aa64 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -125,6 +125,8 @@ sk: removed_header_msg: Úspešne odstránený obrázok hlavičky %{username} resend_confirmation: already_confirmed: Tento užívateľ je už potvrdený + send: Odošli potvrdzovací odkaz znovu + success: Potvrdzovací email úspešne odoslaný! reset: Resetuj reset_password: Obnov heslo resubscribe: Znovu odoberaj @@ -1040,6 +1042,7 @@ sk: confirm_remove_selected_followers: Si si istý/á, že chceš odstrániť vybraných sledovateľov? confirm_remove_selected_follows: Si si istý/á, že chceš odstrániť vybraných sledovaných? dormant: Spiace + follow_failure: Nemožno nasledovať niektoré z vybraných účtov. follow_selected_followers: Následuj označených sledovatelov followers: Následovatelia following: Následovaní diff --git a/config/locales/sr-Latn.yml b/config/locales/sr-Latn.yml index 37166bc03be398..cba4354f0634ee 100644 --- a/config/locales/sr-Latn.yml +++ b/config/locales/sr-Latn.yml @@ -1059,6 +1059,14 @@ sr-Latn: hint_html: Samo još jedna stvar! Moramo da potvrdimo da ste ljudsko biće (ovo je da bismo sprečili neželjenu poštu!). Rešite CAPTCHA ispod i kliknite na „Nastavi”. title: Bezbedonosna provera confirmations: + awaiting_review: Vaša adresa e-pošte je potvrđena! Osoblje %{domain} sada pregleda vašu registraciju. Dobićete e-poštu ako odobre vaš nalog! + awaiting_review_title: Vaša registracija se pregleda + clicking_this_link: klikom na ovu vezu + login_link: prijavi se + proceed_to_login_html: Sada možete da pređete na %{login_link}. + redirect_to_app_html: Trebalo je da budete preusmereni na aplikaciju %{app_name}. Ako se to nije desilo, pokušajte sa %{clicking_this_link} ili se ručno vratite u aplikaciju. + registration_complete: Vaša registracija na %{domain} je sada kompletirana! + welcome_title: Dobro došli, %{name}! wrong_email_hint: Ako ta imejl adresa nije ispravna, možete je promeniti u podešavanjima naloga. delete_account: Brisanje naloga delete_account_html: Ako želite da izbrišete vaš nalog, možete nastaviti ovde. Od vas će se tražiti potvrda. @@ -1855,8 +1863,8 @@ sr-Latn: final_step: 'Počnite da objavljujete! Čak i bez pratilaca, Vaše javne objave su vidljive drugim ljudima, na primer na lokalnoj vremenskoj liniji ili u heš oznakama. Možda želite da se predstavite sa heš oznakom #introductions ili #predstavljanja.' full_handle: Vaš pun nadimak full_handle_hint: Ovo biste rekli svojim prijateljima kako bi vam oni poslali poruku, ili zapratili sa druge instance. - subject: Dobrodošli na Mastodon - title: Dobrodošli, %{name}! + subject: Dobro došli na Mastodon + title: Dobro došli, %{name}! users: follow_limit_reached: Ne možete pratiti više od %{limit} ljudi go_to_sso_account_settings: Idite na podešavanja naloga svog dobavljača identiteta diff --git a/config/locales/sr.yml b/config/locales/sr.yml index ba269488e47454..902f13ad6177ee 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -1059,6 +1059,14 @@ sr: hint_html: Само још једна ствар! Морамо да потврдимо да сте људско биће (ово је да бисмо спречили нежељену пошту!). Решите CAPTCHA испод и кликните на „Настави”. title: Безбедоносна провера confirmations: + awaiting_review: Ваша адреса е-поште је потврђена! Особље %{domain} сада прегледа вашу регистрацију. Добићете е-пошту ако одобре ваш налог! + awaiting_review_title: Ваша регистрација се прегледа + clicking_this_link: кликом на ову везу + login_link: пријави се + proceed_to_login_html: Сада можете да пређете на %{login_link}. + redirect_to_app_html: Требало је да будете преусмерени на апликацију %{app_name}. Ако се то није десило, покушајте са %{clicking_this_link} или се ручно вратите у апликацију. + registration_complete: Ваша регистрација на %{domain} је сада комплетирана! + welcome_title: Добро дошли, %{name}! wrong_email_hint: Ако та имејл адреса није исправна, можете је променити у подешавањима налога. delete_account: Брисање налога delete_account_html: Ако желите да избришете ваш налог, можете наставити овде. Од вас ће се тражити потврда. @@ -1855,8 +1863,8 @@ sr: final_step: 'Почните да објављујете! Чак и без пратилаца, Ваше јавне објаве су видљиве другим људима, на пример на локалној временској линији или у хеш ознакама. Можда желите да се представите са хеш ознаком #introductions или #представљања.' full_handle: Ваш пун надимак full_handle_hint: Ово бисте рекли својим пријатељима како би вам они послали поруку, или запратили са друге инстанце. - subject: Добродошли на Mastodon - title: Добродошли, %{name}! + subject: Добро дошли на Mastodon + title: Добро дошли, %{name}! users: follow_limit_reached: Не можете пратити више од %{limit} људи go_to_sso_account_settings: Идите на подешавања налога свог добављача идентитета diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 72c5295b353be5..1cccb301d19dcf 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -1041,6 +1041,10 @@ sv: hint_html: En sista sak till! Vi måste bekräfta att du är en människa (för att hålla borta skräpinlägg!). Lös CAPTCHA nedan och klicka på "Fortsätt". title: Säkerhetskontroll confirmations: + awaiting_review_title: Din registrering är under granskning + clicking_this_link: klicka på denna länk + registration_complete: Din registrering på %{domain} är nu slutförd! + welcome_title: Välkommen, %{name}! wrong_email_hint: Om e-postadressen inte är rätt, kan du ändra den i kontoinställningarna. delete_account: Radera konto delete_account_html: Om du vill radera ditt konto kan du fortsätta här. Du kommer att bli ombedd att bekräfta. diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 6d3beddbcf025d..7902cea4ddb740 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -1023,6 +1023,14 @@ zh-CN: hint_html: 只剩最后一件事了!我们需要确认您是一个人类(这样我们才能阻止恶意访问!)。请输入下面的验证码,然后点击“继续”。 title: 安全检查 confirmations: + awaiting_review: 您的电子邮件地址已确认!%{domain} 的工作人员正在审核您的注册信息。如果他们批准了您的账户,您将收到一封邮件通知! + awaiting_review_title: 您的注册申请正在审核中 + clicking_this_link: 点击此链接 + login_link: 登录 + proceed_to_login_html: 现在您可以继续前往 %{login_link} 。 + redirect_to_app_html: 您应该已被重定向到 %{app_name} 应用程序。如果没有,请尝试 %{clicking_this_link} 或手动返回应用程序。 + registration_complete: 您在 %{domain} 上的注册现已完成! + welcome_title: 欢迎您,%{name}! wrong_email_hint: 如果该电子邮件地址不正确,您可以在帐户设置中进行更改。 delete_account: 删除帐户 delete_account_html: 如果你想删除你的帐户,请点击这里继续。你需要确认你的操作。 diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 28507b076a2dfc..9d75f50a50560e 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1025,6 +1025,14 @@ zh-TW: hint_html: 僅再一步!我們必須確認您是位人類(這是防止垃圾訊息濫用)。請完成以下 CAPTCHA 挑戰並點擊「繼續」。 title: 安全性檢查 confirmations: + awaiting_review: 已驗證您的電子郵件!%{domain} 的管理員正在審核您的註冊申請。若您的帳號通過審核,您將收到電子郵件通知。 + awaiting_review_title: 我們正在審核您的註冊申請 + clicking_this_link: 點擊這個連結 + login_link: 登入 + proceed_to_login_html: 您現在可以前往 %{login_link}。 + redirect_to_app_html: 您應被重新導向至 %{app_name} 應用程式。如尚未重新導向,請嘗試 %{clicking_this_link} 或手動回到應用程式。 + registration_complete: 您於 %{domain} 之註冊申請已完成! + welcome_title: 歡迎,%{name}! wrong_email_hint: 若電子郵件地址不正確,您可以於帳號設定中更改。 delete_account: 刪除帳號 delete_account_html: 如果您欲刪除您的帳號,請點擊這裡繼續。您需要再三確認您的操作。 diff --git a/lib/mastodon/migration_helpers.rb b/lib/mastodon/migration_helpers.rb index a92a8767ce3957..7bc1298838490b 100644 --- a/lib/mastodon/migration_helpers.rb +++ b/lib/mastodon/migration_helpers.rb @@ -158,10 +158,8 @@ def remove_concurrent_index(table_name, column_name, **options) 'in the body of your migration class' end - if supports_drop_index_concurrently? - options = options.merge({ algorithm: :concurrently }) - disable_statement_timeout - end + options = options.merge({ algorithm: :concurrently }) + disable_statement_timeout remove_index(table_name, **options.merge({ column: column_name })) end @@ -182,28 +180,12 @@ def remove_concurrent_index_by_name(table_name, index_name, **options) 'in the body of your migration class' end - if supports_drop_index_concurrently? - options = options.merge({ algorithm: :concurrently }) - disable_statement_timeout - end + options = options.merge({ algorithm: :concurrently }) + disable_statement_timeout remove_index(table_name, **options.merge({ name: index_name })) end - # Only available on Postgresql >= 9.2 - def supports_drop_index_concurrently? - version = select_one("SELECT current_setting('server_version_num') AS v")['v'].to_i - - version >= 90_200 - end - - # Only available on Postgresql >= 11 - def supports_add_column_with_default? - version = select_one("SELECT current_setting('server_version_num') AS v")['v'].to_i - - version >= 110_000 - end - # Adds a foreign key with only minimal locking on the tables involved. # # This method only requires minimal locking when using PostgreSQL. When @@ -420,42 +402,7 @@ def update_column_in_batches(table_name, column, value) # This method can also take a block which is passed directly to the # `update_column_in_batches` method. def add_column_with_default(table, column, type, default:, limit: nil, allow_null: false, &block) - if supports_add_column_with_default? - add_column(table, column, type, default: default, limit: limit, null: allow_null) - return - end - - if transaction_open? - raise 'add_column_with_default can not be run inside a transaction, ' \ - 'you can disable transactions by calling disable_ddl_transaction! ' \ - 'in the body of your migration class' - end - - disable_statement_timeout - - transaction do - if limit - add_column(table, column, type, default: nil, limit: limit) - else - add_column(table, column, type, default: nil) - end - - # Changing the default before the update ensures any newly inserted - # rows already use the proper default value. - change_column_default(table, column, default) - end - - begin - update_column_in_batches(table, column, default, &block) - - change_column_null(table, column, false) unless allow_null - # We want to rescue _all_ exceptions here, even those that don't inherit - # from StandardError. - rescue Exception => error # rubocop: disable all - remove_column(table, column) - - raise error - end + add_column(table, column, type, default: default, limit: limit, null: allow_null) end # Renames a column without requiring downtime. diff --git a/yarn.lock b/yarn.lock index 01431c8b489a49..b3aea91e1eeb93 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1779,9 +1779,9 @@ "@jridgewell/sourcemap-codec" "^1.4.14" "@material-symbols/svg-600@^0.13.1": - version "0.13.1" - resolved "https://registry.yarnpkg.com/@material-symbols/svg-600/-/svg-600-0.13.1.tgz#9f1c2a1fa4439e6cc9ad5f7a7ef64ce7691b42c8" - integrity sha512-oI4De/ePwj1IBxtabmpqMy092Y4ius0byQo/BC3yvLY4WbtzQlIScxUY7bUx+Gqrwq03QZDYrgP/cU4a/TXqyA== + version "0.13.2" + resolved "https://registry.yarnpkg.com/@material-symbols/svg-600/-/svg-600-0.13.2.tgz#a98361ed5a100492780e3301c9d9e4d79aefe0f1" + integrity sha512-4n/bbh6444ZfJ72VHYrWc2f2E8PCsC6ue/ou4Q4QqQFvSRbQSZjcSXuTb0lA4xkaIf2cJf4grvF8ZsskIBLbHg== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -10970,9 +10970,9 @@ sass-loader@^10.2.0: semver "^7.3.2" sass@^1.62.1: - version "1.69.4" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.69.4.tgz#10c735f55e3ea0b7742c6efa940bce30e07fbca2" - integrity sha512-+qEreVhqAy8o++aQfCJwp0sklr2xyEzkm9Pp/Igu9wNPoe7EZEQ8X/MBvvXggI2ql607cxKg/RKOwDj6pp2XDA== + version "1.69.5" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.69.5.tgz#23e18d1c757a35f2e52cc81871060b9ad653dfde" + integrity sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ== dependencies: chokidar ">=3.0.0 <4.0.0" immutable "^4.0.0"