show.html.haml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. - content_for :page_title do
  2. = t('settings.relationships')
  3. - content_for :header_tags do
  4. = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous'
  5. .filters
  6. .filter-subset
  7. %strong= t 'relationships.relationship'
  8. %ul
  9. %li= filter_link_to t('relationships.following'), relationship: nil
  10. %li= filter_link_to t('relationships.followers'), relationship: 'followed_by'
  11. %li= filter_link_to t('relationships.mutual'), relationship: 'mutual'
  12. .filter-subset
  13. %strong= t 'relationships.status'
  14. %ul
  15. %li= filter_link_to t('generic.all'), status: nil
  16. %li= filter_link_to t('relationships.primary'), status: 'primary'
  17. %li= filter_link_to t('relationships.moved'), status: 'moved'
  18. .filter-subset
  19. %strong= t 'relationships.activity'
  20. %ul
  21. %li= filter_link_to t('generic.all'), activity: nil
  22. %li= filter_link_to t('relationships.dormant'), activity: 'dormant'
  23. .filter-subset
  24. %strong= t 'generic.order_by'
  25. %ul
  26. %li= filter_link_to t('relationships.most_recent'), order: nil
  27. %li= filter_link_to t('relationships.last_active'), order: 'active'
  28. = form_with model: @form, url: relationships_path, method: :patch do |f|
  29. = hidden_field_tag :page, params[:page] || 1
  30. - RelationshipFilter::KEYS.each do |key|
  31. = hidden_field_tag key, params[key] if params[key].present?
  32. .batch-table
  33. .batch-table__toolbar
  34. %label.batch-table__toolbar__select.batch-checkbox-all
  35. = check_box_tag :batch_checkbox_all, nil, false
  36. .batch-table__toolbar__actions
  37. - if followed_by_relationship? && !mutual_relationship?
  38. = f.button safe_join([material_symbol('person_add'), t('relationships.follow_selected_followers')]),
  39. class: 'table-action-link',
  40. data: { confirm: t('relationships.confirm_follow_selected_followers') },
  41. name: :follow,
  42. type: :submit
  43. - unless followed_by_relationship?
  44. = f.button safe_join([material_symbol('person_remove'), t('relationships.remove_selected_follows')]),
  45. class: 'table-action-link',
  46. data: { confirm: t('relationships.confirm_remove_selected_follows') },
  47. name: :unfollow,
  48. type: :submit
  49. - unless following_relationship?
  50. = f.button safe_join([material_symbol('delete'), t('relationships.remove_selected_followers')]),
  51. class: 'table-action-link',
  52. data: { confirm: t('relationships.confirm_remove_selected_followers') },
  53. name: :remove_from_followers,
  54. type: :submit
  55. - if followed_by_relationship?
  56. = f.button safe_join([material_symbol('delete'), t('relationships.remove_selected_domains')]),
  57. class: 'table-action-link',
  58. data: { confirm: t('admin.reports.are_you_sure') },
  59. name: :remove_domains_from_followers,
  60. type: :submit
  61. .batch-table__body
  62. - if @accounts.empty?
  63. = nothing_here 'nothing-here--under-tabs'
  64. - else
  65. = render partial: 'account', collection: @accounts, locals: { f: f, relationships: @relationships }
  66. = paginate @accounts