Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - app/views/admin/settings/edit.html.haml: Conflict due to how the theming settings change.
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
|
||||
.fields-group
|
||||
= f.simple_fields_for :account do |account_fields|
|
||||
= account_fields.input :username, wrapper: :with_label, autofocus: true, label: false, required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.username'), :autocomplete => 'off', placeholder: t('simple_form.labels.defaults.username') }, append: "@#{site_hostname}", hint: false, disabled: !Setting.open_registrations
|
||||
= account_fields.input :username, wrapper: :with_label, autofocus: true, label: false, required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.username'), :autocomplete => 'off', placeholder: t('simple_form.labels.defaults.username') }, append: "@#{site_hostname}", hint: false, disabled: closed_registrations?
|
||||
|
||||
= f.input :email, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email'), :autocomplete => 'off' }, hint: false, disabled: !Setting.open_registrations
|
||||
= f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off' }, hint: false, disabled: !Setting.open_registrations
|
||||
= f.input :password_confirmation, placeholder: t('simple_form.labels.defaults.confirm_password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.confirm_password'), :autocomplete => 'off' }, hint: false, disabled: !Setting.open_registrations
|
||||
= f.input :email, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations?
|
||||
= f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations?
|
||||
= f.input :password_confirmation, placeholder: t('simple_form.labels.defaults.confirm_password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.confirm_password'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations?
|
||||
|
||||
.fields-group
|
||||
= f.input :agreement, as: :boolean, wrapper: :with_label, label: t('auth.checkbox_agreement_html', rules_path: about_more_path, terms_path: terms_path), disabled: !Setting.open_registrations
|
||||
= f.input :agreement, as: :boolean, wrapper: :with_label, label: t('auth.checkbox_agreement_html', rules_path: about_more_path, terms_path: terms_path), disabled: closed_registrations?
|
||||
|
||||
.actions
|
||||
= f.button :button, Setting.open_registrations ? t('auth.register') : t('auth.registration_closed', instance: site_hostname), type: :submit, class: 'button button-primary', disabled: !Setting.open_registrations
|
||||
= f.button :button, sign_up_message, type: :submit, class: 'button button-primary', disabled: closed_registrations?
|
||||
|
@@ -5,7 +5,7 @@
|
||||
%div{ style: 'margin: -2px 0' }= account_badge(account, all: true)
|
||||
%td
|
||||
- if account.user_current_sign_in_ip
|
||||
%samp= account.user_current_sign_in_ip
|
||||
%samp.ellipsized-ip{ title: account.user_current_sign_in_ip }= account.user_current_sign_in_ip
|
||||
- else
|
||||
\-
|
||||
%td
|
||||
@@ -14,5 +14,9 @@
|
||||
- else
|
||||
\-
|
||||
%td
|
||||
= table_link_to 'circle', t('admin.accounts.web'), web_path("accounts/#{account.id}")
|
||||
= table_link_to 'globe', t('admin.accounts.public'), TagManager.instance.url_for(account)
|
||||
- if account.local? && account.user_pending?
|
||||
= table_link_to 'check', t('admin.accounts.approve'), approve_admin_account_path(account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:approve, account.user)
|
||||
= table_link_to 'times', t('admin.accounts.reject'), reject_admin_account_path(account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:reject, account.user)
|
||||
- else
|
||||
= table_link_to 'circle', t('admin.accounts.web'), web_path("accounts/#{account.id}")
|
||||
= table_link_to 'globe', t('admin.accounts.public'), TagManager.instance.url_for(account)
|
||||
|
@@ -10,9 +10,10 @@
|
||||
.filter-subset
|
||||
%strong= t('admin.accounts.moderation.title')
|
||||
%ul
|
||||
%li= filter_link_to t('admin.accounts.moderation.active'), silenced: nil, suspended: nil
|
||||
%li= filter_link_to t('admin.accounts.moderation.silenced'), silenced: '1', suspended: nil
|
||||
%li= filter_link_to t('admin.accounts.moderation.suspended'), suspended: '1', silenced: nil
|
||||
%li= filter_link_to t('admin.accounts.moderation.pending'), pending: '1', silenced: nil, suspended: nil
|
||||
%li= filter_link_to t('admin.accounts.moderation.active'), silenced: nil, suspended: nil, pending: nil
|
||||
%li= filter_link_to t('admin.accounts.moderation.silenced'), silenced: '1', suspended: nil, pending: nil
|
||||
%li= filter_link_to t('admin.accounts.moderation.suspended'), suspended: '1', silenced: nil, pending: nil
|
||||
.filter-subset
|
||||
%strong= t('admin.accounts.role')
|
||||
%ul
|
||||
|
@@ -37,6 +37,8 @@
|
||||
%span.red= t('admin.accounts.disabled')
|
||||
- elsif @account.local? && !@account.user&.confirmed?
|
||||
%span.neutral= t('admin.accounts.confirming')
|
||||
- elsif @account.local? && !@account.user_approved?
|
||||
%span.neutral= t('admin.accounts.pending')
|
||||
- else
|
||||
%span.neutral= t('admin.accounts.no_limits_imposed')
|
||||
.dashboard__counters__label= t 'admin.accounts.login_status'
|
||||
@@ -95,7 +97,7 @@
|
||||
%td
|
||||
- if @account.user&.disabled?
|
||||
= table_link_to 'unlock', t('admin.accounts.enable'), enable_admin_account_path(@account.id), method: :post if can?(:enable, @account.user)
|
||||
- else
|
||||
- elsif @account.user_approved?
|
||||
= table_link_to 'lock', t('admin.accounts.disable'), new_admin_account_action_path(@account.id, type: 'disable') if can?(:disable, @account.user)
|
||||
|
||||
%tr
|
||||
@@ -144,26 +146,30 @@
|
||||
= link_to t('admin.accounts.reset_password'), admin_account_reset_path(@account.id), method: :create, class: 'button' if can?(:reset_password, @account.user)
|
||||
- if @account.user&.otp_required_for_login?
|
||||
= link_to t('admin.accounts.disable_two_factor_authentication'), admin_user_two_factor_authentication_path(@account.user.id), method: :delete, class: 'button' if can?(:disable_2fa, @account.user)
|
||||
- unless @account.memorial?
|
||||
- if !@account.memorial? && @account.user_approved?
|
||||
= link_to t('admin.accounts.memorialize'), memorialize_admin_account_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button button--destructive' if can?(:memorialize, @account)
|
||||
- else
|
||||
= link_to t('admin.accounts.redownload'), redownload_admin_account_path(@account.id), method: :post, class: 'button' if can?(:redownload, @account)
|
||||
|
||||
%div{ style: 'float: left' }
|
||||
- if @account.local?
|
||||
- if @account.local? && @account.user_approved?
|
||||
= link_to t('admin.accounts.warn'), new_admin_account_action_path(@account.id, type: 'none'), class: 'button' if can?(:warn, @account)
|
||||
- if @account.silenced?
|
||||
= link_to t('admin.accounts.undo_silenced'), unsilence_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsilence, @account)
|
||||
- else
|
||||
- elsif !@account.local? || @account.user_approved?
|
||||
= link_to t('admin.accounts.silence'), new_admin_account_action_path(@account.id, type: 'silence'), class: 'button button--destructive' if can?(:silence, @account)
|
||||
|
||||
- if @account.local?
|
||||
- if @account.user_pending?
|
||||
= link_to t('admin.accounts.approve'), approve_admin_account_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button' if can?(:approve, @account.user)
|
||||
= link_to t('admin.accounts.reject'), reject_admin_account_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button button--destructive' if can?(:reject, @account.user)
|
||||
|
||||
- unless @account.user_confirmed?
|
||||
= link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button' if can?(:confirm, @account.user)
|
||||
|
||||
- if @account.suspended?
|
||||
= link_to t('admin.accounts.undo_suspension'), unsuspend_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsuspend, @account)
|
||||
- else
|
||||
- elsif !@account.local? || @account.user_approved?
|
||||
= link_to t('admin.accounts.perform_full_suspension'), new_admin_account_action_path(@account.id, type: 'suspend'), class: 'button button--destructive' if can?(:suspend, @account)
|
||||
|
||||
- unless @account.local?
|
||||
|
@@ -1,21 +1,29 @@
|
||||
%tr
|
||||
%td
|
||||
.input-copy
|
||||
.input-copy__wrapper
|
||||
%input{ type: :text, maxlength: '999', spellcheck: 'false', readonly: 'true', value: public_invite_url(invite_code: invite.code) }
|
||||
%button{ type: :button }= t('generic.copy')
|
||||
|
||||
%td
|
||||
.name-tag
|
||||
= image_tag invite.user.account.avatar.url(:original), alt: '', width: 16, height: 16, class: 'avatar'
|
||||
%span.username= invite.user.account.username
|
||||
%td
|
||||
= invite.uses
|
||||
= " / #{invite.max_uses}" unless invite.max_uses.nil?
|
||||
%td
|
||||
- if invite.expired?
|
||||
|
||||
- if invite.expired?
|
||||
%td{ colspan: 2 }
|
||||
= t('invites.expired')
|
||||
- else
|
||||
- else
|
||||
%td
|
||||
= fa_icon 'user fw'
|
||||
= invite.uses
|
||||
= " / #{invite.max_uses}" unless invite.max_uses.nil?
|
||||
%td
|
||||
- if invite.expires_at.nil?
|
||||
∞
|
||||
- else
|
||||
%time.formatted{ datetime: invite.expires_at.iso8601, title: l(invite.expires_at) }
|
||||
= l invite.expires_at
|
||||
%td= table_link_to 'link', public_invite_url(invite_code: invite.code), public_invite_url(invite_code: invite.code)
|
||||
%td
|
||||
- if !invite.expired? && policy(invite).destroy?
|
||||
= table_link_to 'times', t('invites.delete'), admin_invite_path(invite), method: :delete
|
||||
|
@@ -18,15 +18,15 @@
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
.table-wrapper
|
||||
%table.table
|
||||
.table-wrapper.simple_form
|
||||
%table.table.table--invites
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
%th
|
||||
%th= t('invites.table.uses')
|
||||
%th= t('invites.table.expires_at')
|
||||
%th
|
||||
%th
|
||||
%tbody
|
||||
= render @invites
|
||||
|
||||
|
@@ -6,8 +6,11 @@
|
||||
.fields-group
|
||||
= f.input :site_title, wrapper: :with_label, label: t('admin.settings.site_title')
|
||||
|
||||
.fields-group
|
||||
= f.input :flavour_and_skin, collection: Themes.instance.flavours_and_skins, group_label_method: lambda { |(flavour, _)| I18n.t("flavours.#{flavour}.name", default: flavour) }, wrapper: :with_label, include_blank: false, as: :grouped_select, label_method: :last, value_method: lambda { |value| value.join('/') }, group_method: :last
|
||||
.fields-row
|
||||
.fields-row__column.fields-row__column-6.fields-group
|
||||
= f.input :flavour_and_skin, collection: Themes.instance.flavours_and_skins, group_label_method: lambda { |(flavour, _)| I18n.t("flavours.#{flavour}.name", default: flavour) }, wrapper: :with_label, include_blank: false, as: :grouped_select, label_method: :last, value_method: lambda { |value| value.join('/') }, group_method: :last
|
||||
.fields-row__column.fields-row__column-6.fields-group
|
||||
= f.input :registrations_mode, collection: %w(open approved none), wrapper: :with_label, label: t('admin.settings.registrations_mode.title'), include_blank: false, label_method: lambda { |mode| I18n.t("admin.settings.registrations_mode.modes.#{mode}") }
|
||||
|
||||
.fields-row
|
||||
.fields-row__column.fields-row__column-6.fields-group
|
||||
@@ -47,9 +50,6 @@
|
||||
.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')
|
||||
|
||||
.fields-group
|
||||
= f.input :open_registrations, as: :boolean, wrapper: :with_label, label: t('admin.settings.registrations.open.title'), hint: t('admin.settings.registrations.open.desc_html')
|
||||
|
||||
.fields-group
|
||||
= f.input :open_deletion, as: :boolean, wrapper: :with_label, label: t('admin.settings.registrations.deletion.title'), hint: t('admin.settings.registrations.deletion.desc_html')
|
||||
|
||||
|
8
app/views/admin_mailer/new_pending_account.text.erb
Normal file
8
app/views/admin_mailer/new_pending_account.text.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<%= raw t('application_mailer.salutation', name: display_name(@me)) %>
|
||||
|
||||
<%= raw t('admin_mailer.new_pending_account.body') %>
|
||||
|
||||
<%= raw t('admin.accounts.email') %>: <%= @account.user_email %>
|
||||
<%= raw t('admin.accounts.most_recent_ip') %>: <%= @account.user_current_sign_in_ip %>
|
||||
|
||||
<%= raw t('application_mailer.view')%> <%= admin_account_url(@account.id) %>
|
@@ -29,6 +29,6 @@
|
||||
%p.hint= t('auth.agreement_html', rules_path: about_more_path, terms_path: terms_path)
|
||||
|
||||
.actions
|
||||
= f.button :button, t('auth.register'), type: :submit
|
||||
= f.button :button, sign_up_message, type: :submit
|
||||
|
||||
.form-footer= render 'auth/shared/links'
|
||||
|
@@ -3,7 +3,7 @@
|
||||
%li= link_to t('auth.login'), new_session_path(resource_name)
|
||||
|
||||
- if devise_mapping.registerable? && controller_name != 'registrations'
|
||||
%li= link_to t('auth.register'), open_registrations? ? new_registration_path(resource_name) : 'https://joinmastodon.org/#getting-started'
|
||||
%li= link_to t('auth.register'), available_sign_up_path
|
||||
|
||||
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
|
||||
%li= link_to t('auth.forgot_password'), new_password_path(resource_name)
|
||||
|
@@ -1,17 +1,25 @@
|
||||
%tr
|
||||
%td
|
||||
= invite.uses
|
||||
= " / #{invite.max_uses}" unless invite.max_uses.nil?
|
||||
%td
|
||||
- if invite.expired?
|
||||
.input-copy
|
||||
.input-copy__wrapper
|
||||
%input{ type: :text, maxlength: '999', spellcheck: 'false', readonly: 'true', value: public_invite_url(invite_code: invite.code) }
|
||||
%button{ type: :button }= t('generic.copy')
|
||||
|
||||
- if invite.expired?
|
||||
%td{ colspan: 2 }
|
||||
= t('invites.expired')
|
||||
- else
|
||||
- else
|
||||
%td
|
||||
= fa_icon 'user fw'
|
||||
= invite.uses
|
||||
= " / #{invite.max_uses}" unless invite.max_uses.nil?
|
||||
%td
|
||||
- if invite.expires_at.nil?
|
||||
∞
|
||||
- else
|
||||
%time.formatted{ datetime: invite.expires_at.iso8601, title: l(invite.expires_at) }
|
||||
= l invite.expires_at
|
||||
%td= table_link_to 'link', public_invite_url(invite_code: invite.code), public_invite_url(invite_code: invite.code)
|
||||
|
||||
%td
|
||||
- if !invite.expired? && policy(invite).destroy?
|
||||
= table_link_to 'times', t('invites.delete'), invite_path(invite), method: :delete
|
||||
|
@@ -8,12 +8,13 @@
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
%table.table
|
||||
%thead
|
||||
%tr
|
||||
%th= t('invites.table.uses')
|
||||
%th= t('invites.table.expires_at')
|
||||
%th
|
||||
%th
|
||||
%tbody
|
||||
= render @invites
|
||||
.simple_form
|
||||
%table.table.table--invites
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
%th= t('invites.table.uses')
|
||||
%th= t('invites.table.expires_at')
|
||||
%th
|
||||
%tbody
|
||||
= render @invites
|
||||
|
@@ -7,8 +7,7 @@
|
||||
= link_to root_url, class: 'brand' do
|
||||
= image_tag asset_pack_path('logo_full.svg'), alt: 'Mastodon'
|
||||
|
||||
- if Setting.profile_directory
|
||||
= link_to t('directories.directory'), explore_path, class: 'nav-link optional'
|
||||
= link_to t('directories.directory'), explore_path, class: 'nav-link optional' if Setting.profile_directory
|
||||
= link_to t('about.about_this'), about_more_path, class: 'nav-link optional'
|
||||
= link_to t('about.apps'), 'https://joinmastodon.org/apps', class: 'nav-link optional'
|
||||
.nav-center
|
||||
@@ -17,7 +16,7 @@
|
||||
= link_to t('settings.back'), root_url, class: 'nav-link nav-button webapp-btn'
|
||||
- else
|
||||
= link_to t('auth.login'), new_user_session_path, class: 'webapp-btn nav-link nav-button'
|
||||
= link_to t('auth.register'), open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started', class: 'webapp-btn nav-link nav-button'
|
||||
= link_to t('auth.register'), available_sign_up_path, class: 'webapp-btn nav-link nav-button'
|
||||
|
||||
.container= yield
|
||||
|
||||
|
@@ -17,4 +17,4 @@
|
||||
|
||||
%p.hint.subtle-hint
|
||||
= t('remote_follow.reason_html', instance: site_hostname)
|
||||
= t('remote_follow.no_account_html', sign_up_path: open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started')
|
||||
= t('remote_follow.no_account_html', sign_up_path: available_sign_up_path)
|
||||
|
@@ -21,4 +21,4 @@
|
||||
|
||||
%p.hint.subtle-hint
|
||||
= t('remote_follow.reason_html', instance: site_hostname)
|
||||
= t('remote_follow.no_account_html', sign_up_path: open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started')
|
||||
= t('remote_follow.no_account_html', sign_up_path: available_sign_up_path)
|
||||
|
@@ -36,7 +36,7 @@
|
||||
%tbody
|
||||
%tr
|
||||
%td.column-cell.text-center
|
||||
%p= t 'devise.mailer.confirmation_instructions.explanation', host: site_hostname
|
||||
%p= t @resource.approved? ? 'devise.mailer.confirmation_instructions.explanation' : 'devise.mailer.confirmation_instructions.explanation_when_pending', host: site_hostname
|
||||
|
||||
%table.email-table{ cellspacing: 0, cellpadding: 0 }
|
||||
%tbody
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
===
|
||||
|
||||
<%= t 'devise.mailer.confirmation_instructions.explanation', host: site_hostname %>
|
||||
<%= t @resource.approved? ? 'devise.mailer.confirmation_instructions.explanation' : 'devise.mailer.confirmation_instructions.explanation_when_pending', host: site_hostname %>
|
||||
|
||||
=> <%= confirmation_url(@resource, confirmation_token: @token, redirect_to_app: @resource.created_by_application ? 'true' : nil) %>
|
||||
|
||||
|
Reference in New Issue
Block a user