show.html.haml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. - content_for :page_title do
  2. = t('admin.follow_recommendations.title')
  3. %p= t('admin.follow_recommendations.description_html')
  4. %hr.spacer/
  5. = form_tag admin_follow_recommendations_path, method: 'GET', class: 'simple_form' do
  6. - RelationshipFilter::KEYS.each do |key|
  7. = hidden_field_tag key, params[key] if params[key].present?
  8. .filters
  9. .filter-subset.filter-subset--with-select
  10. %strong= t('admin.follow_recommendations.language')
  11. .input.select.optional
  12. = select_tag :language, options_for_select(Trends.available_locales.map { |key| [standard_locale_name(key), key] }, @language)
  13. .filter-subset
  14. %strong= t('admin.follow_recommendations.status')
  15. %ul
  16. %li= filter_link_to t('admin.accounts.moderation.active'), status: nil
  17. %li= filter_link_to t('admin.follow_recommendations.suppressed'), status: 'suppressed'
  18. = form_for(@form, url: admin_follow_recommendations_path, method: :patch) do |f|
  19. - RelationshipFilter::KEYS.each do |key|
  20. = hidden_field_tag key, params[key] if params[key].present?
  21. .batch-table
  22. .batch-table__toolbar
  23. %label.batch-table__toolbar__select.batch-checkbox-all
  24. = check_box_tag :batch_checkbox_all, nil, false
  25. .batch-table__toolbar__actions
  26. - if params[:status].blank? && can?(:suppress, :follow_recommendation)
  27. = f.button safe_join([fa_icon('times'), t('admin.follow_recommendations.suppress')]), name: :suppress, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  28. - if params[:status] == 'suppressed' && can?(:unsuppress, :follow_recommendation)
  29. = f.button safe_join([fa_icon('plus'), t('admin.follow_recommendations.unsuppress')]), name: :unsuppress, class: 'table-action-link', type: :submit
  30. .batch-table__body
  31. - if @accounts.empty?
  32. = nothing_here 'nothing-here--under-tabs'
  33. - else
  34. = render partial: 'account', collection: @accounts, locals: { f: f }