Use material symbols in table link helper (#31359)
This commit is contained in:
parent
c75f7262ed
commit
71405eabfc
25 changed files with 47 additions and 36 deletions
|
@ -1,12 +1,12 @@
|
|||
- if account.avatar?
|
||||
%tr
|
||||
%th= t('admin.accounts.avatar')
|
||||
%td= table_link_to 'trash', t('admin.accounts.remove_avatar'), remove_avatar_admin_account_path(account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:remove_avatar, account)
|
||||
%td= table_link_to 'delete', t('admin.accounts.remove_avatar'), remove_avatar_admin_account_path(account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:remove_avatar, account)
|
||||
%td
|
||||
- if account.header?
|
||||
%tr
|
||||
%th= t('admin.accounts.header')
|
||||
%td= table_link_to 'trash', t('admin.accounts.remove_header'), remove_header_admin_account_path(account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:remove_header, account)
|
||||
%td= table_link_to 'delete', t('admin.accounts.remove_header'), remove_header_admin_account_path(account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:remove_header, account)
|
||||
%td
|
||||
%tr
|
||||
%th= t('admin.accounts.role')
|
||||
|
@ -16,7 +16,7 @@
|
|||
- else
|
||||
= account.user_role&.name
|
||||
%td
|
||||
= table_link_to 'vcard', t('admin.accounts.change_role.label'), admin_user_role_path(account.user) if can?(:change_role, account.user)
|
||||
= table_link_to 'contact_mail', t('admin.accounts.change_role.label'), admin_user_role_path(account.user) if can?(:change_role, account.user)
|
||||
%tr
|
||||
%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
|
||||
|
@ -25,7 +25,7 @@
|
|||
%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)
|
||||
%td= table_link_to 'hide_source', 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')
|
||||
|
@ -48,7 +48,7 @@
|
|||
= t 'admin.accounts.security_measures.only_password'
|
||||
%td
|
||||
- if account.user&.two_factor_enabled? && can?(:disable_2fa, account.user)
|
||||
= table_link_to 'unlock', t('admin.accounts.disable_two_factor_authentication'), admin_user_two_factor_authentication_path(account.user.id), method: :delete
|
||||
= table_link_to 'lock_open', t('admin.accounts.disable_two_factor_authentication'), admin_user_two_factor_authentication_path(account.user.id), method: :delete
|
||||
- if can?(:reset_password, account.user)
|
||||
%tr
|
||||
%td
|
||||
|
|
|
@ -12,4 +12,4 @@
|
|||
= material_symbol DeliveryFailureTracker.available?(account.shared_inbox_url) ? 'check' : 'close'
|
||||
%td
|
||||
- if domain_block.nil?
|
||||
= table_link_to 'ban', t('admin.domain_blocks.add_new'), new_admin_domain_block_path(_domain: account.domain)
|
||||
= table_link_to 'hide_source', t('admin.domain_blocks.add_new'), new_admin_domain_block_path(_domain: account.domain)
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
%div
|
||||
- if can?(:update, announcement)
|
||||
- if announcement.published?
|
||||
= table_link_to 'toggle-off', t('admin.announcements.unpublish'), unpublish_admin_announcement_path(announcement), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
= table_link_to 'toggle_off', t('admin.announcements.unpublish'), unpublish_admin_announcement_path(announcement), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
- else
|
||||
= table_link_to 'toggle-on', t('admin.announcements.publish'), publish_admin_announcement_path(announcement), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
= table_link_to 'toggle_on', t('admin.announcements.publish'), publish_admin_announcement_path(announcement), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
|
||||
= table_link_to 'trash', t('generic.delete'), admin_announcement_path(announcement), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, announcement)
|
||||
= table_link_to 'delete', t('generic.delete'), admin_announcement_path(announcement), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, announcement)
|
||||
|
|
|
@ -27,4 +27,4 @@
|
|||
|
||||
%td
|
||||
- if invite.valid_for_use? && policy(invite).destroy?
|
||||
= table_link_to 'times', t('invites.delete'), admin_invite_path(invite), method: :delete
|
||||
= table_link_to 'close', t('invites.delete'), admin_invite_path(invite), method: :delete
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
= t 'admin.relays.disabled'
|
||||
%td
|
||||
- if relay.accepted?
|
||||
= table_link_to 'power-off', t('admin.relays.disable'), disable_admin_relay_path(relay), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
= table_link_to 'power_off', t('admin.relays.disable'), disable_admin_relay_path(relay), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
- elsif !relay.pending?
|
||||
= table_link_to 'power-off', t('admin.relays.enable'), enable_admin_relay_path(relay), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
= table_link_to 'power_off', t('admin.relays.enable'), enable_admin_relay_path(relay), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
|
||||
= table_link_to 'times', t('admin.relays.delete'), admin_relay_path(relay), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
= table_link_to 'close', t('admin.relays.delete'), admin_relay_path(relay), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
- if can?(:destroy, report_note)
|
||||
.report-notes__item__actions
|
||||
- if report_note.is_a?(AccountModerationNote)
|
||||
= table_link_to 'trash', t('admin.reports.notes.delete'), admin_account_moderation_note_path(report_note), method: :delete
|
||||
= table_link_to 'delete', t('admin.reports.notes.delete'), admin_account_moderation_note_path(report_note), method: :delete
|
||||
- else
|
||||
= table_link_to 'trash', t('admin.reports.notes.delete'), admin_report_note_path(report_note), method: :delete
|
||||
= table_link_to 'delete', t('admin.reports.notes.delete'), admin_report_note_path(report_note), method: :delete
|
||||
|
|
|
@ -54,6 +54,6 @@
|
|||
= admin_account_link_to report.assigned_account
|
||||
—
|
||||
- if report.assigned_account != current_user.account
|
||||
= table_link_to 'user', t('admin.reports.assign_to_self'), assign_to_self_admin_report_path(report), method: :post
|
||||
= table_link_to 'person', t('admin.reports.assign_to_self'), assign_to_self_admin_report_path(report), method: :post
|
||||
- elsif !report.assigned_account.nil?
|
||||
= table_link_to 'trash', t('admin.reports.unassign'), unassign_admin_report_path(report), method: :post
|
||||
= table_link_to 'delete', t('admin.reports.unassign'), unassign_admin_report_path(report), method: :post
|
||||
|
|
|
@ -27,4 +27,4 @@
|
|||
·
|
||||
%abbr{ title: role.permissions_as_keys.map { |privilege| I18n.t("admin.roles.privileges.#{privilege}") }.join(', ') }= t('admin.roles.permissions_count', count: role.permissions_as_keys.size)
|
||||
%div
|
||||
= table_link_to 'pencil', t('admin.accounts.edit'), edit_admin_role_path(role) if can?(:update, role)
|
||||
= table_link_to 'edit', t('admin.accounts.edit'), edit_admin_role_path(role) if can?(:update, role)
|
||||
|
|
|
@ -8,4 +8,4 @@
|
|||
= rule.hint
|
||||
|
||||
%div
|
||||
= table_link_to 'trash', t('admin.rules.delete'), admin_rule_path(rule), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, rule)
|
||||
= table_link_to 'delete', t('admin.rules.delete'), admin_rule_path(rule), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, rule)
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
= 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)
|
||||
= table_link_to 'delete', 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)
|
||||
|
|
|
@ -15,5 +15,5 @@
|
|||
%abbr{ title: webhook.events.join(', ') }= t('admin.webhooks.enabled_events', count: webhook.events.size)
|
||||
|
||||
%div
|
||||
= table_link_to 'pencil', t('admin.webhooks.edit'), edit_admin_webhook_path(webhook) if can?(:update, webhook)
|
||||
= table_link_to 'trash', t('admin.webhooks.delete'), admin_webhook_path(webhook), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, webhook)
|
||||
= table_link_to 'edit', t('admin.webhooks.edit'), edit_admin_webhook_path(webhook) if can?(:update, webhook)
|
||||
= table_link_to 'delete', t('admin.webhooks.delete'), admin_webhook_path(webhook), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, webhook)
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
%td
|
||||
- if @webhook.enabled?
|
||||
%span.positive-hint= t('admin.webhooks.enabled')
|
||||
= table_link_to 'power-off', t('admin.webhooks.disable'), disable_admin_webhook_path(@webhook), method: :post if can?(:disable, @webhook)
|
||||
= table_link_to 'power_off', t('admin.webhooks.disable'), disable_admin_webhook_path(@webhook), method: :post if can?(:disable, @webhook)
|
||||
- else
|
||||
%span.negative-hint= t('admin.webhooks.disabled')
|
||||
= table_link_to 'power-off', t('admin.webhooks.enable'), enable_admin_webhook_path(@webhook), method: :post if can?(:enable, @webhook)
|
||||
= table_link_to 'power_off', t('admin.webhooks.enable'), enable_admin_webhook_path(@webhook), method: :post if can?(:enable, @webhook)
|
||||
%tr
|
||||
%th= t('admin.webhooks.events')
|
||||
%td
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue