index.html.haml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. - content_for :page_title do
  2. = t('admin.instances.title')
  3. - content_for :heading_actions do
  4. - if limited_federation_mode?
  5. = link_to t('admin.domain_allows.add_new'), new_admin_domain_allow_path, class: 'button', id: 'add-instance-button'
  6. = link_to t('admin.domain_allows.export'), export_admin_export_domain_allows_path(format: :csv), class: 'button'
  7. = link_to t('admin.domain_allows.import'), new_admin_export_domain_allow_path, class: 'button'
  8. - else
  9. = link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path, class: 'button', id: 'add-instance-button'
  10. = link_to t('admin.domain_blocks.export'), export_admin_export_domain_blocks_path(format: :csv), class: 'button'
  11. = link_to t('admin.domain_blocks.import'), new_admin_export_domain_block_path, class: 'button'
  12. .filters
  13. .filter-subset
  14. %strong= t('admin.instances.moderation.title')
  15. %ul
  16. %li= filter_link_to t('admin.instances.moderation.all'), limited: nil
  17. - unless limited_federation_mode?
  18. %li= filter_link_to t('admin.instances.moderation.limited'), limited: '1'
  19. .filter-subset
  20. %strong= t('admin.instances.availability.title')
  21. %ul
  22. %li= filter_link_to t('admin.instances.delivery.all'), availability: nil
  23. %li= filter_link_to t('admin.instances.delivery.failing'), availability: 'failing'
  24. %li= filter_link_to t('admin.instances.delivery.unavailable'), availability: 'unavailable'
  25. - unless limited_federation_mode?
  26. = form_tag admin_instances_url, method: 'GET', class: 'simple_form' do
  27. .fields-group
  28. - InstanceFilter::KEYS.each do |key|
  29. = hidden_field_tag key, params[key] if params[key].present?
  30. - %i(by_domain).each do |key|
  31. .input.string.optional
  32. = text_field_tag key, params[key], class: 'string optional', placeholder: I18n.t("admin.instances.#{key}")
  33. .actions
  34. %button.button= t('admin.accounts.search')
  35. = link_to t('admin.accounts.reset'), admin_instances_path, class: 'button negative'
  36. %hr.spacer/
  37. - if @instances.empty?
  38. .muted-hint.center-text
  39. = t 'admin.instances.empty'
  40. - else
  41. = render partial: 'instance', collection: @instances
  42. = paginate @instances