index.html.haml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. - content_for :page_title do
  2. = t('admin.trends.links.title')
  3. - content_for :header_tags do
  4. = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous'
  5. %p= t('admin.trends.links.description_html')
  6. %hr.spacer/
  7. = form_tag admin_trends_links_path, method: 'GET', class: 'simple_form' do
  8. - Trends::PreviewCardFilter::KEYS.each do |key|
  9. = hidden_field_tag key, params[key] if params[key].present?
  10. .filters
  11. .filter-subset.filter-subset--with-select
  12. %strong= t('admin.follow_recommendations.language')
  13. .input.select.optional
  14. = select_tag :locale, options_for_select(@locales.map { |key| [standard_locale_name(key), key] }, params[:locale]), include_blank: true
  15. .filter-subset
  16. %strong= t('admin.trends.trending')
  17. %ul
  18. %li= filter_link_to t('generic.all'), trending: nil
  19. %li= filter_link_to t('admin.trends.only_allowed'), trending: 'allowed'
  20. .back-link
  21. = link_to admin_trends_links_preview_card_providers_path do
  22. = t('admin.trends.preview_card_providers.title')
  23. = fa_icon 'chevron-right fw'
  24. = form_for(@form, url: batch_admin_trends_links_path) do |f|
  25. = hidden_field_tag :page, params[:page] || 1
  26. - Trends::PreviewCardFilter::KEYS.each do |key|
  27. = hidden_field_tag key, params[key] if params[key].present?
  28. .batch-table
  29. .batch-table__toolbar
  30. %label.batch-table__toolbar__select.batch-checkbox-all
  31. = check_box_tag :batch_checkbox_all, nil, false
  32. .batch-table__toolbar__actions
  33. = f.button safe_join([fa_icon('check'), t('admin.trends.links.allow')]), name: :approve, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  34. = f.button safe_join([fa_icon('check'), t('admin.trends.links.allow_provider')]), name: :approve_providers, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  35. = f.button safe_join([fa_icon('times'), t('admin.trends.links.disallow')]), name: :reject, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  36. = f.button safe_join([fa_icon('times'), t('admin.trends.links.disallow_provider')]), name: :reject_providers, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  37. .batch-table__body
  38. - if @preview_cards.empty?
  39. = nothing_here 'nothing-here--under-tabs'
  40. - else
  41. = render partial: 'preview_card', collection: @preview_cards, locals: { f: f }
  42. = paginate @preview_cards