about summary refs log tree commit diff
path: root/app/views/admin/instances/index.html.haml
blob: 8f7e3e67d2b3b8fc6270f45460c0a1db27b3c5e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
- content_for :page_title do
  = t('admin.instances.title')

- content_for :header_tags do
  = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous'

- content_for :heading_actions do
  - if whitelist_mode?
    = link_to t('admin.domain_allows.add_new'), new_admin_domain_allow_path, class: 'button', id: 'add-instance-button'
    = link_to t('admin.domain_allows.export'), export_admin_export_domain_allows_path(format: :csv), class: 'button'
    = link_to t('admin.domain_allows.import'), new_admin_export_domain_allow_path, class: 'button'
  - else
    = link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path, class: 'button', id: 'add-instance-button'
    = link_to t('admin.domain_blocks.export'), export_admin_export_domain_blocks_path(format: :csv), class: 'button'
    = link_to t('admin.domain_blocks.import'), new_admin_export_domain_block_path, class: 'button'

.filters
  .filter-subset
    %strong= t('admin.instances.moderation.title')
    %ul
      %li= filter_link_to t('admin.instances.moderation.all'), limited: nil

      - unless whitelist_mode?
        %li= filter_link_to t('admin.instances.moderation.limited'), limited: '1'

  .filter-subset
    %strong= t('admin.instances.availability.title')
    %ul
      %li= filter_link_to t('admin.instances.delivery.all'), availability: nil
      %li= filter_link_to t('admin.instances.delivery.failing'), availability: 'failing'
      %li= filter_link_to t('admin.instances.delivery.unavailable'), availability: 'unavailable'

- unless whitelist_mode?
  = form_tag admin_instances_url, method: 'GET', class: 'simple_form' do
    .fields-group
      - InstanceFilter::KEYS.each do |key|
        = hidden_field_tag key, params[key] if params[key].present?

      - %i(by_domain).each do |key|
        .input.string.optional
          = text_field_tag key, params[key], class: 'string optional', placeholder: I18n.t("admin.instances.#{key}")

      .actions
        %button.button= t('admin.accounts.search')
        = link_to t('admin.accounts.reset'), admin_instances_path, class: 'button negative'

%hr.spacer/

- if @instances.empty?
  %div.muted-hint.center-text
    = t 'admin.instances.empty'
- else
  = render partial: 'instance', collection: @instances

= paginate @instances