mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-20 03:25:17 +01:00
Helper method for deletion req due at
This commit is contained in:
parent
29df8edbcd
commit
690da4c1e7
@ -11,8 +11,28 @@ module Admin::AccountsHelper
|
||||
]
|
||||
end
|
||||
|
||||
def remote_suspension_hint(deletion_request)
|
||||
if deletion_request.present?
|
||||
t('admin.accounts.remote_suspension_reversible_hint_html', date: due_date_for_hint(deletion_request))
|
||||
else
|
||||
t('admin.accounts.remote_suspension_irreversible')
|
||||
end
|
||||
end
|
||||
|
||||
def suspension_hint(deletion_request)
|
||||
if deletion_request.present?
|
||||
t('admin.accounts.suspension_reversible_hint_html', date: due_date_for_hint(deletion_request))
|
||||
else
|
||||
t('admin.accounts.suspension_irreversible')
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def due_date_for_hint(deletion_request)
|
||||
tag.strong(l(deletion_request.due_at.to_date))
|
||||
end
|
||||
|
||||
def pending_user_count_label
|
||||
number_with_delimiter User.pending.count
|
||||
end
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
%p.muted-hint
|
||||
- if account.suspension_origin_remote?
|
||||
= deletion_request.present? ? t('admin.accounts.remote_suspension_reversible_hint_html', date: content_tag(:strong, l(deletion_request.due_at.to_date))) : t('admin.accounts.remote_suspension_irreversible')
|
||||
= remote_suspension_hint(deletion_request)
|
||||
- else
|
||||
= deletion_request.present? ? t('admin.accounts.suspension_reversible_hint_html', date: content_tag(:strong, l(deletion_request.due_at.to_date))) : t('admin.accounts.suspension_irreversible')
|
||||
= suspension_hint(deletion_request)
|
||||
|
||||
- if can?(:unsuspend, account)
|
||||
= button_to t('admin.accounts.undo_suspension'),
|
||||
@ -20,6 +20,6 @@
|
||||
- if deletion_request.present? && can?(:destroy, account)
|
||||
= link_to t('admin.accounts.delete'),
|
||||
admin_account_path(account.id),
|
||||
class: 'button button--destructive',
|
||||
class: [:button, 'button--destructive'],
|
||||
data: { confirm: t('admin.accounts.are_you_sure') },
|
||||
method: :delete
|
||||
|
Loading…
Reference in New Issue
Block a user