2016-12-13 23:42:10 +11:00
|
|
|
- content_for :page_title do
|
2017-04-14 05:49:07 +10:00
|
|
|
= t('admin.accounts.title')
|
2016-12-13 23:42:10 +11:00
|
|
|
|
2017-05-18 08:38:01 +10:00
|
|
|
= form_tag admin_accounts_url, method: 'GET', class: 'simple_form' do
|
2022-07-05 10:41:40 +10:00
|
|
|
.filters
|
|
|
|
.filter-subset.filter-subset--with-select
|
|
|
|
%strong= t('admin.accounts.location.title')
|
|
|
|
.input.select.optional
|
2024-03-15 22:19:00 +11:00
|
|
|
= 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')
|
2022-07-05 10:41:40 +10:00
|
|
|
.filter-subset.filter-subset--with-select
|
|
|
|
%strong= t('admin.accounts.moderation.title')
|
|
|
|
.input.select.optional
|
2024-03-15 22:19:00 +11:00
|
|
|
= select_tag :status,
|
|
|
|
options_for_select(admin_accounts_moderation_options, params[:status]),
|
|
|
|
prompt: I18n.t('generic.all')
|
2022-07-05 10:41:40 +10:00
|
|
|
.filter-subset.filter-subset--with-select
|
|
|
|
%strong= t('admin.accounts.role')
|
|
|
|
.input.select.optional
|
2024-03-15 22:19:00 +11:00
|
|
|
= select_tag :role_ids,
|
|
|
|
options_from_collection_for_select(UserRole.assignable, :id, :name, params[:role_ids]),
|
|
|
|
prompt: I18n.t('admin.accounts.moderation.all')
|
2022-07-05 10:41:40 +10:00
|
|
|
.filter-subset.filter-subset--with-select
|
|
|
|
%strong= t 'generic.order_by'
|
|
|
|
.input.select
|
2024-03-15 22:19:00 +11:00
|
|
|
= select_tag :order,
|
|
|
|
options_for_select([[t('relationships.most_recent'), 'recent'], [t('relationships.last_active'), 'active']], params[:order])
|
2017-05-17 11:00:34 +10:00
|
|
|
|
2022-07-05 10:41:40 +10:00
|
|
|
.fields-group
|
2017-11-02 00:46:05 +11:00
|
|
|
- %i(username by_domain display_name email ip).each do |key|
|
2023-10-26 21:52:14 +11:00
|
|
|
- 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}")
|
2017-05-17 11:00:34 +10:00
|
|
|
|
2022-07-05 10:41:40 +10:00
|
|
|
.actions
|
|
|
|
%button.button= t('admin.accounts.search')
|
|
|
|
= link_to t('admin.accounts.reset'), admin_accounts_path, class: 'button negative'
|
|
|
|
|
|
|
|
%hr.spacer/
|
2017-05-17 11:00:34 +10:00
|
|
|
|
2021-12-06 07:48:39 +11:00
|
|
|
= form_for(@form, url: batch_admin_accounts_path) do |f|
|
|
|
|
= hidden_field_tag :page, params[:page] || 1
|
2022-08-26 07:33:34 +10:00
|
|
|
= hidden_field_tag :select_all_matching, '0'
|
2021-12-06 07:48:39 +11:00
|
|
|
|
|
|
|
- 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
|
2023-07-19 01:43:04 +10:00
|
|
|
- if @accounts.any?(&:user_pending?)
|
2024-03-15 22:19:00 +11:00
|
|
|
= f.button safe_join([fa_icon('check'), t('admin.accounts.approve')]),
|
|
|
|
class: 'table-action-link',
|
|
|
|
data: { confirm: t('admin.reports.are_you_sure') },
|
|
|
|
name: :approve,
|
|
|
|
type: :submit
|
2021-12-06 07:48:39 +11:00
|
|
|
|
2024-03-15 22:19:00 +11:00
|
|
|
= f.button safe_join([fa_icon('times'), t('admin.accounts.reject')]),
|
|
|
|
class: 'table-action-link',
|
|
|
|
data: { confirm: t('admin.reports.are_you_sure') },
|
|
|
|
name: :reject,
|
|
|
|
type: :submit
|
2021-12-06 07:48:39 +11:00
|
|
|
|
2024-03-15 22:19:00 +11:00
|
|
|
= f.button safe_join([fa_icon('lock'), t('admin.accounts.perform_full_suspension')]),
|
|
|
|
class: 'table-action-link',
|
|
|
|
data: { confirm: t('admin.reports.are_you_sure') },
|
|
|
|
name: :suspend,
|
|
|
|
type: :submit
|
2022-08-26 10:11:23 +10:00
|
|
|
- if @accounts.total_count > @accounts.size
|
2022-08-26 07:33:34 +10:00
|
|
|
.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')
|
2021-12-06 07:48:39 +11:00
|
|
|
.batch-table__body
|
|
|
|
- if @accounts.empty?
|
|
|
|
= nothing_here 'nothing-here--under-tabs'
|
|
|
|
- else
|
|
|
|
= render partial: 'account', collection: @accounts, locals: { f: f }
|
2016-12-04 05:30:13 +11:00
|
|
|
|
2017-04-11 09:11:41 +10:00
|
|
|
= paginate @accounts
|