about summary refs log tree commit diff
path: root/app/views/admin/instances/index.html.haml
blob: 1d85aa75e018d5c08321c76e74987466930408dd (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
56
57
58
59
60
61
62
63
64
- content_for :page_title do
  = t('admin.instances.title')

.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'

  %div{ style: 'flex: 1 1 auto; text-align: right' }
    - if whitelist_mode?
      = link_to t('admin.domain_allows.add_new'), new_admin_domain_allow_path, class: 'button'
    - else
      = link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path, class: 'button'

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

      - %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= t('admin.accounts.search')
        = link_to t('admin.accounts.reset'), admin_instances_path, class: 'button negative'

%hr.spacer/

- @instances.each do |instance|
  .directory__tag
    = link_to admin_instance_path(instance) do
      %h4
        = instance.domain
        %small
          - if instance.domain_block
            - first_item = true
            - if !instance.domain_block.noop?
              = t("admin.domain_blocks.severity.#{instance.domain_block.severity}")
              - first_item = false
            - unless instance.domain_block.suspend?
              - if instance.domain_block.reject_media?
                - unless first_item
                  •
                = t('admin.domain_blocks.rejecting_media')
                - first_item = false
              - if instance.domain_block.reject_reports?
                - unless first_item
                  •
                = t('admin.domain_blocks.rejecting_reports')
          - elsif whitelist_mode?
            = t('admin.accounts.whitelisted')
          - else
            = t('admin.accounts.no_limits_imposed')
      - if instance.countable?
        .trends__item__current{ title: t('admin.instances.known_accounts', count: instance.accounts_count) }= number_to_human instance.accounts_count, strip_insignificant_zeros: true

= paginate paginated_instances