1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
mastodon/app/views/admin/accounts/index.html.haml
Matt Jankowski 32ead51e5a
Add material design icons to admin/settings views (#27780)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2024-04-23 16:43:49 +00:00

87 lines
3.8 KiB
Text

- content_for :page_title do
= t('admin.accounts.title')
= form_tag admin_accounts_url, method: 'GET', class: 'simple_form' do
.filters
.filter-subset.filter-subset--with-select
%strong= t('admin.accounts.location.title')
.input.select.optional
= select_tag :origin,
options_for_select([[t('admin.accounts.location.local'), 'local'], [t('admin.accounts.location.remote'), 'remote']], params[:origin]),
prompt: I18n.t('generic.all')
.filter-subset.filter-subset--with-select
%strong= t('admin.accounts.moderation.title')
.input.select.optional
= select_tag :status,
options_for_select(admin_accounts_moderation_options, params[:status]),
prompt: I18n.t('generic.all')
.filter-subset.filter-subset--with-select
%strong= t('admin.accounts.role')
.input.select.optional
= select_tag :role_ids,
options_from_collection_for_select(UserRole.assignable, :id, :name, params[:role_ids]),
prompt: I18n.t('admin.accounts.moderation.all')
.filter-subset.filter-subset--with-select
%strong= t 'generic.order_by'
.input.select
= select_tag :order,
options_for_select([[t('relationships.most_recent'), 'recent'], [t('relationships.last_active'), 'active']], params[:order])
.fields-group
- %i(username by_domain display_name email ip).each do |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')
= link_to t('admin.accounts.reset'), admin_accounts_path, class: 'button negative'
%hr.spacer/
= form_for(@form, url: batch_admin_accounts_path) do |f|
= hidden_field_tag :page, params[:page] || 1
= hidden_field_tag :select_all_matching, '0'
- AccountFilter::KEYS.each do |key|
= hidden_field_tag key, params[key] if params[key].present?
.batch-table
.batch-table__toolbar
%label.batch-table__toolbar__select.batch-checkbox-all
= check_box_tag :batch_checkbox_all, nil, false
.batch-table__toolbar__actions
- if @accounts.any?(&:user_pending?)
= f.button safe_join([material_symbol('check'), t('admin.accounts.approve')]),
class: 'table-action-link',
data: { confirm: t('admin.reports.are_you_sure') },
name: :approve,
type: :submit
= f.button safe_join([material_symbol('close'), t('admin.accounts.reject')]),
class: 'table-action-link',
data: { confirm: t('admin.reports.are_you_sure') },
name: :reject,
type: :submit
= f.button safe_join([material_symbol('lock'), t('admin.accounts.perform_full_suspension')]),
class: 'table-action-link',
data: { confirm: t('admin.reports.are_you_sure') },
name: :suspend,
type: :submit
- if @accounts.total_count > @accounts.size
.batch-table__select-all
.not-selected.active
%span= t('generic.all_items_on_page_selected_html', count: @accounts.size)
%button{ type: 'button' }= t('generic.select_all_matching_items', count: @accounts.total_count)
.selected
%span= t('generic.all_matching_items_selected_html', count: @accounts.total_count)
%button{ type: 'button' }= t('generic.deselect')
.batch-table__body
- if @accounts.empty?
= nothing_here 'nothing-here--under-tabs'
- else
= render partial: 'account', collection: @accounts, locals: { f: f }
= paginate @accounts