Merge tag 'v3.1.4' into hometown-dev
This commit is contained in:
@ -21,7 +21,7 @@
|
||||
|
||||
- unless @warning_presets.empty?
|
||||
.fields-group
|
||||
= f.input :warning_preset_id, collection: @warning_presets, label_method: :text, wrapper: :with_block_label
|
||||
= f.input :warning_preset_id, collection: @warning_presets, label_method: ->(warning_preset) { [warning_preset.title.presence, truncate(warning_preset.text)].compact.join(' - ') }, wrapper: :with_block_label
|
||||
|
||||
.fields-group
|
||||
= f.input :text, as: :text, wrapper: :with_block_label, hint: t('simple_form.hints.admin_account_action.text_html', path: admin_warning_presets_path)
|
||||
|
@ -2,7 +2,7 @@
|
||||
%td
|
||||
= admin_account_link_to(account)
|
||||
%td
|
||||
%div{ style: 'margin: -2px 0' }= account_badge(account, all: true)
|
||||
%div.account-badges= account_badge(account, all: true)
|
||||
%td
|
||||
- if account.user_current_sign_in_ip
|
||||
%samp.ellipsized-ip{ title: account.user_current_sign_in_ip }= account.user_current_sign_in_ip
|
||||
@ -11,6 +11,8 @@
|
||||
%td
|
||||
- if account.user_current_sign_in_at
|
||||
%time.time-ago{ datetime: account.user_current_sign_in_at.iso8601, title: l(account.user_current_sign_in_at) }= l account.user_current_sign_in_at
|
||||
- elsif account.last_status_at.present?
|
||||
%time.time-ago{ datetime: account.last_status_at.iso8601, title: l(account.last_status_at) }= l account.last_status_at
|
||||
- else
|
||||
\-
|
||||
%td
|
||||
|
@ -19,6 +19,12 @@
|
||||
%ul
|
||||
%li= filter_link_to t('admin.accounts.moderation.all'), staff: nil
|
||||
%li= filter_link_to t('admin.accounts.roles.staff'), staff: '1'
|
||||
.filter-subset
|
||||
%strong= t 'generic.order_by'
|
||||
%ul
|
||||
%li= filter_link_to t('relationships.most_recent'), order: nil
|
||||
%li= filter_link_to t('admin.accounts.username'), order: 'alphabetic'
|
||||
%li= filter_link_to t('relationships.last_active'), order: 'active'
|
||||
|
||||
= form_tag admin_accounts_url, method: 'GET', class: 'simple_form' do
|
||||
.fields-group
|
||||
|
@ -31,7 +31,7 @@
|
||||
%div
|
||||
.account__header__content.emojify= Formatter.instance.simplified_format(account, custom_emojify: true)
|
||||
|
||||
.dashboard__counters{ style: 'margin-top: 10px' }
|
||||
.dashboard__counters.admin-account-counters
|
||||
%div
|
||||
= link_to admin_account_statuses_path(@account.id) do
|
||||
.dashboard__counters__num= number_with_delimiter @account.statuses_count
|
||||
@ -53,7 +53,7 @@
|
||||
.dashboard__counters__num= number_with_delimiter @account.targeted_reports.count
|
||||
.dashboard__counters__label= t '.targeted_reports'
|
||||
%div
|
||||
%div
|
||||
= link_to admin_action_logs_path(target_account_id: @account.id) do
|
||||
.dashboard__counters__text
|
||||
- if @account.local? && @account.user.nil?
|
||||
%span.neutral= t('admin.accounts.deleted')
|
||||
@ -96,10 +96,17 @@
|
||||
= table_link_to 'angle-double-down', t('admin.accounts.demote'), demote_admin_account_role_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:demote, @account.user)
|
||||
|
||||
%tr
|
||||
%th= t('admin.accounts.email')
|
||||
%td= @account.user_email
|
||||
%th{ rowspan: can?(:create, :email_domain_block) ? 3 : 2 }= t('admin.accounts.email')
|
||||
%td{ rowspan: can?(:create, :email_domain_block) ? 3 : 2 }= @account.user_email
|
||||
%td= table_link_to 'edit', t('admin.accounts.change_email.label'), admin_account_change_email_path(@account.id) if can?(:change_email, @account.user)
|
||||
|
||||
%tr
|
||||
%td= table_link_to 'search', t('admin.accounts.search_same_email_domain'), admin_accounts_path(email: "%@#{@account.user_email.split('@').last}")
|
||||
|
||||
- if can?(:create, :email_domain_block)
|
||||
%tr
|
||||
%td= table_link_to 'ban', t('admin.accounts.add_email_domain_block'), new_admin_email_domain_block_path(_domain: @account.user_email.split('@').last)
|
||||
|
||||
- if @account.user_unconfirmed_email.present?
|
||||
%tr
|
||||
%th= t('admin.accounts.unconfirmed_email')
|
||||
@ -164,25 +171,15 @@
|
||||
%th= t('admin.accounts.inbox_url')
|
||||
%td
|
||||
= @account.inbox_url
|
||||
= fa_icon DeliveryFailureTracker.unavailable?(@account.inbox_url) ? 'times' : 'check'
|
||||
= fa_icon DeliveryFailureTracker.available?(@account.inbox_url) ? 'check' : 'times'
|
||||
%tr
|
||||
%th= t('admin.accounts.shared_inbox_url')
|
||||
%td
|
||||
= @account.shared_inbox_url
|
||||
= fa_icon DeliveryFailureTracker.unavailable?(@account.shared_inbox_url) ? 'times' : 'check'
|
||||
= fa_icon DeliveryFailureTracker.available?(@account.shared_inbox_url) ? 'check': 'times'
|
||||
|
||||
%div{ style: 'overflow: hidden' }
|
||||
%div{ style: 'float: right' }
|
||||
- if @account.local?
|
||||
= 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)
|
||||
- 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' }
|
||||
%div.action-buttons
|
||||
%div
|
||||
- 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?
|
||||
@ -204,11 +201,21 @@
|
||||
= 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?
|
||||
- if DomainBlock.where(domain: @account.domain).exists?
|
||||
- if DomainBlock.rule_for(@account.domain)
|
||||
= link_to t('admin.domain_blocks.view'), admin_instance_path(@account.domain), class: 'button'
|
||||
- else
|
||||
= link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path(_domain: @account.domain), class: 'button button--destructive'
|
||||
|
||||
%div
|
||||
- if @account.local?
|
||||
= 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)
|
||||
- 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)
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
- unless @warnings.empty?
|
||||
|
@ -7,9 +7,3 @@
|
||||
= t("admin.action_logs.actions.#{action_log.action}_#{action_log.target_type.underscore}", name: content_tag(:span, action_log.account.username, class: 'username'), target: content_tag(:span, log_target(action_log), class: 'target')).html_safe
|
||||
.log-entry__timestamp
|
||||
%time.formatted{ datetime: action_log.created_at.iso8601 }
|
||||
.spacer
|
||||
.log-entry__icon
|
||||
= fa_icon icon_for_log(action_log)
|
||||
.log-entry__icon__overlay{ class: class_for_log_icon(action_log) }
|
||||
.log-entry__extras
|
||||
= log_extra_attributes relevant_log_changes(action_log)
|
||||
|
@ -1,6 +1,28 @@
|
||||
- content_for :page_title do
|
||||
= t('admin.action_logs.title')
|
||||
|
||||
= render @action_logs
|
||||
- content_for :header_tags do
|
||||
= javascript_pack_tag 'admin', integrity: true, async: true, crossorigin: 'anonymous'
|
||||
|
||||
= form_tag admin_action_logs_url, method: 'GET', class: 'simple_form' do
|
||||
= hidden_field_tag :target_account_id, params[:target_account_id] if params[:target_account_id].present?
|
||||
|
||||
.filters
|
||||
.filter-subset.filter-subset--with-select
|
||||
%strong= t('admin.action_logs.filter_by_user')
|
||||
.input.select.optional
|
||||
= select_tag :account_id, options_from_collection_for_select(Account.joins(:user).merge(User.staff), :id, :username, params[:account_id]), prompt: I18n.t('admin.accounts.moderation.all')
|
||||
|
||||
.filter-subset.filter-subset--with-select
|
||||
%strong= t('admin.action_logs.filter_by_action')
|
||||
.input.select.optional
|
||||
= select_tag :action_type, options_for_select(Admin::ActionLogFilter::ACTION_TYPE_MAP.keys.map { |key| [I18n.t("admin.action_logs.action_types.#{key}"), key]}, params[:action_type]), prompt: I18n.t('admin.accounts.moderation.all')
|
||||
|
||||
- if @action_logs.empty?
|
||||
%div.muted-hint.center-text
|
||||
= t 'admin.action_logs.empty'
|
||||
- else
|
||||
.announcements-list
|
||||
= render @action_logs
|
||||
|
||||
= paginate @action_logs
|
||||
|
@ -3,3 +3,13 @@
|
||||
%samp= email_domain_block.domain
|
||||
%td
|
||||
= table_link_to 'trash', t('admin.email_domain_blocks.delete'), admin_email_domain_block_path(email_domain_block), method: :delete
|
||||
|
||||
- email_domain_block.children.each do |child_email_domain_block|
|
||||
%tr
|
||||
%td
|
||||
%samp= child_email_domain_block.domain
|
||||
%span.muted-hint
|
||||
= surround '(', ')' do
|
||||
= t('admin.email_domain_blocks.from_html', domain: content_tag(:samp, email_domain_block.domain))
|
||||
%td
|
||||
= table_link_to 'trash', t('admin.email_domain_blocks.delete'), admin_email_domain_block_path(child_email_domain_block), method: :delete
|
||||
|
@ -5,7 +5,10 @@
|
||||
= render 'shared/error_messages', object: @email_domain_block
|
||||
|
||||
.fields-group
|
||||
= f.input :domain, wrapper: :with_label, label: t('admin.email_domain_blocks.domain')
|
||||
= f.input :domain, wrapper: :with_block_label, label: t('admin.email_domain_blocks.domain')
|
||||
|
||||
.fields-group
|
||||
= f.input :with_dns_records, as: :boolean, wrapper: :with_label
|
||||
|
||||
.actions
|
||||
= f.button :button, t('.create'), type: :submit
|
||||
|
@ -10,7 +10,7 @@
|
||||
- unless whitelist_mode?
|
||||
%li= filter_link_to t('admin.instances.moderation.limited'), limited: '1'
|
||||
|
||||
%div{ style: 'flex: 1 1 auto; text-align: right' }
|
||||
%div.special-action-button
|
||||
- if whitelist_mode?
|
||||
= link_to t('admin.domain_allows.add_new'), new_admin_domain_allow_path, class: 'button'
|
||||
- else
|
||||
|
@ -45,11 +45,11 @@
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
%div{ style: 'overflow: hidden' }
|
||||
%div{ style: 'float: left' }
|
||||
%div.action-buttons
|
||||
%div
|
||||
= link_to t('admin.accounts.title'), admin_accounts_path(remote: '1', by_domain: @instance.domain), class: 'button'
|
||||
|
||||
%div{ style: 'float: right' }
|
||||
%div
|
||||
- if @domain_allow
|
||||
= link_to t('admin.domain_allows.undo'), admin_domain_allow_path(@domain_allow), class: 'button button--destructive', data: { confirm: t('admin.accounts.are_you_sure'), method: :delete }
|
||||
- elsif @domain_block
|
||||
|
@ -25,9 +25,9 @@
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
%div{ style: 'overflow: hidden' }
|
||||
%div{ style: 'float: right' }
|
||||
= link_to t('admin.accounts.reject_all'), reject_all_admin_pending_accounts_path, method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button button--destructive'
|
||||
|
||||
%div.action-buttons
|
||||
%div
|
||||
= link_to t('admin.accounts.approve_all'), approve_all_admin_pending_accounts_path, method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button'
|
||||
|
||||
%div
|
||||
= link_to t('admin.accounts.reject_all'), reject_all_admin_pending_accounts_path, method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button button--destructive'
|
||||
|
@ -17,7 +17,7 @@
|
||||
%li= filter_link_to t('admin.accounts.location.local'), location: 'local'
|
||||
%li= filter_link_to t('admin.accounts.location.remote'), location: 'remote'
|
||||
|
||||
.back-link{ style: 'flex: 1 1 auto; text-align: right' }
|
||||
.back-link
|
||||
= link_to admin_account_path(@account.id) do
|
||||
= fa_icon 'chevron-left fw'
|
||||
= t('admin.statuses.back_to_account')
|
||||
|
@ -25,7 +25,7 @@
|
||||
- target_account = reports.first.target_account
|
||||
.report-card
|
||||
.report-card__profile
|
||||
= account_link_to target_account, '', size: 36, path: admin_account_path(target_account.id)
|
||||
= account_link_to target_account, '', path: admin_account_path(target_account.id)
|
||||
.report-card__profile__stats
|
||||
= link_to t('admin.reports.account.notes', count: target_account.targeted_moderation_notes.count), admin_account_path(target_account.id)
|
||||
%br/
|
||||
|
@ -68,9 +68,11 @@
|
||||
|
||||
%hr.spacer
|
||||
|
||||
%div{ style: 'overflow: hidden; margin-bottom: 20px; clear: both' }
|
||||
%div.action-buttons
|
||||
%div
|
||||
|
||||
- if @report.unresolved?
|
||||
%div{ style: 'float: right' }
|
||||
%div
|
||||
- if @report.target_account.local?
|
||||
= link_to t('admin.accounts.warn'), new_admin_account_action_path(@report.target_account_id, type: 'none', report_id: @report.id), class: 'button'
|
||||
= link_to t('admin.accounts.disable'), new_admin_account_action_path(@report.target_account_id, type: 'disable', report_id: @report.id), class: 'button button--destructive'
|
||||
|
@ -4,7 +4,10 @@
|
||||
- content_for :page_title do
|
||||
= t('admin.settings.title')
|
||||
|
||||
= simple_form_for @admin_settings, url: admin_settings_path, html: { method: :patch } do |f|
|
||||
- content_for :heading_actions do
|
||||
= button_tag t('generic.save_changes'), class: 'button', form: 'edit_admin'
|
||||
|
||||
= simple_form_for @admin_settings, url: admin_settings_path, html: { method: :patch, id: 'edit_admin' } do |f|
|
||||
= render 'shared/error_messages', object: @admin_settings
|
||||
|
||||
.fields-group
|
||||
@ -30,13 +33,13 @@
|
||||
|
||||
.fields-row
|
||||
.fields-row__column.fields-row__column-6.fields-group
|
||||
= f.input :thumbnail, as: :file, wrapper: :with_block_label, label: t('admin.settings.thumbnail.title'), hint: t('admin.settings.thumbnail.desc_html')
|
||||
= f.input :thumbnail, as: :file, wrapper: :with_block_label, label: t('admin.settings.thumbnail.title'), hint: site_upload_delete_hint(t('admin.settings.thumbnail.desc_html'), :thumbnail)
|
||||
.fields-row__column.fields-row__column-6.fields-group
|
||||
= f.input :hero, as: :file, wrapper: :with_block_label, label: t('admin.settings.hero.title'), hint: t('admin.settings.hero.desc_html')
|
||||
= f.input :hero, as: :file, wrapper: :with_block_label, label: t('admin.settings.hero.title'), hint: site_upload_delete_hint(t('admin.settings.hero.desc_html'), :hero)
|
||||
|
||||
.fields-row
|
||||
.fields-row__column.fields-row__column-6.fields-group
|
||||
= f.input :mascot, as: :file, wrapper: :with_block_label, label: t('admin.settings.mascot.title'), hint: t('admin.settings.mascot.desc_html')
|
||||
= f.input :mascot, as: :file, wrapper: :with_block_label, label: t('admin.settings.mascot.title'), hint: site_upload_delete_hint(t('admin.settings.mascot.desc_html'), :mascot)
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
%ul
|
||||
%li= link_to t('admin.statuses.no_media'), admin_account_statuses_path(@account.id, current_params.merge(media: nil)), class: !params[:media] && 'selected'
|
||||
%li= link_to t('admin.statuses.with_media'), admin_account_statuses_path(@account.id, current_params.merge(media: true)), class: params[:media] && 'selected'
|
||||
.back-link{ style: 'flex: 1 1 auto; text-align: right' }
|
||||
.back-link
|
||||
= link_to admin_account_path(@account.id) do
|
||||
= fa_icon 'chevron-left fw'
|
||||
= t('admin.statuses.back_to_account')
|
||||
|
@ -4,7 +4,7 @@
|
||||
= "@#{@account.acct}"
|
||||
|
||||
.filters
|
||||
.back-link{ style: 'flex: 1 1 auto; text-align: right' }
|
||||
.back-link
|
||||
= link_to admin_account_path(@account.id) do
|
||||
%i.fa.fa-chevron-left.fa-fw
|
||||
= t('admin.statuses.back_to_account')
|
||||
|
@ -71,9 +71,9 @@
|
||||
- if params[:pending_review] == '1' || params[:unreviewed] == '1'
|
||||
%hr.spacer/
|
||||
|
||||
%div{ style: 'overflow: hidden' }
|
||||
%div{ style: 'float: right' }
|
||||
= link_to t('admin.accounts.reject_all'), reject_all_admin_tags_path, method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button button--destructive'
|
||||
|
||||
%div.action-buttons
|
||||
%div
|
||||
= link_to t('admin.accounts.approve_all'), approve_all_admin_tags_path, method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button'
|
||||
|
||||
%div
|
||||
= link_to t('admin.accounts.reject_all'), reject_all_admin_tags_path, method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button button--destructive'
|
||||
|
10
app/views/admin/warning_presets/_warning_preset.html.haml
Normal file
10
app/views/admin/warning_presets/_warning_preset.html.haml
Normal file
@ -0,0 +1,10 @@
|
||||
.announcements-list__item
|
||||
= link_to edit_admin_warning_preset_path(warning_preset), class: 'announcements-list__item__title' do
|
||||
= warning_preset.title.presence || truncate(warning_preset.text)
|
||||
|
||||
.announcements-list__item__action-bar
|
||||
.announcements-list__item__meta
|
||||
= truncate(warning_preset.text)
|
||||
|
||||
%div
|
||||
= table_link_to 'trash', t('admin.warning_presets.delete'), admin_warning_preset_path(warning_preset), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, warning_preset)
|
@ -4,6 +4,9 @@
|
||||
= simple_form_for @warning_preset, url: admin_warning_preset_path(@warning_preset) do |f|
|
||||
= render 'shared/error_messages', object: @warning_preset
|
||||
|
||||
.fields-group
|
||||
= f.input :title, wrapper: :with_block_label
|
||||
|
||||
.fields-group
|
||||
= f.input :text, wrapper: :with_block_label
|
||||
|
||||
|
@ -5,6 +5,9 @@
|
||||
= simple_form_for @warning_preset, url: admin_warning_presets_path do |f|
|
||||
= render 'shared/error_messages', object: @warning_preset
|
||||
|
||||
.fields-group
|
||||
= f.input :title, wrapper: :with_block_label
|
||||
|
||||
.fields-group
|
||||
= f.input :text, wrapper: :with_block_label
|
||||
|
||||
@ -13,18 +16,9 @@
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
- unless @warning_presets.empty?
|
||||
.table-wrapper
|
||||
%table.table
|
||||
%thead
|
||||
%tr
|
||||
%th= t('simple_form.labels.account_warning_preset.text')
|
||||
%th
|
||||
%tbody
|
||||
- @warning_presets.each do |preset|
|
||||
%tr
|
||||
%td
|
||||
= Formatter.instance.linkify(preset.text)
|
||||
%td
|
||||
= table_link_to 'pencil', t('admin.warning_presets.edit'), edit_admin_warning_preset_path(preset)
|
||||
= table_link_to 'trash', t('admin.warning_presets.delete'), admin_warning_preset_path(preset), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
- if @warning_presets.empty?
|
||||
%div.muted-hint.center-text
|
||||
= t 'admin.warning_presets.empty'
|
||||
- else
|
||||
.announcements-list
|
||||
= render partial: 'warning_preset', collection: @warning_presets
|
||||
|
Reference in New Issue
Block a user