index.html.haml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. - content_for :page_title do
  2. = t('admin.trends.links.title')
  3. %p= t('admin.trends.links.description_html')
  4. %hr.spacer/
  5. = form_tag admin_trends_links_path, method: 'GET', class: 'simple_form' do
  6. - Trends::PreviewCardFilter::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 :locale, options_for_select(@locales.map { |key| [standard_locale_name(key), key] }, params[:locale]), include_blank: true
  13. .filter-subset
  14. %strong= t('admin.trends.trending')
  15. %ul
  16. %li= filter_link_to t('generic.all'), trending: nil
  17. %li= filter_link_to t('admin.trends.only_allowed'), trending: 'allowed'
  18. .back-link
  19. = link_to admin_trends_links_preview_card_providers_path do
  20. = t('admin.trends.preview_card_providers.title')
  21. = fa_icon 'chevron-right fw'
  22. = form_for(@form, url: batch_admin_trends_links_path) do |f|
  23. = hidden_field_tag :page, params[:page] || 1
  24. - Trends::PreviewCardFilter::KEYS.each do |key|
  25. = hidden_field_tag key, params[key] if params[key].present?
  26. .batch-table
  27. .batch-table__toolbar
  28. %label.batch-table__toolbar__select.batch-checkbox-all
  29. = check_box_tag :batch_checkbox_all, nil, false
  30. .batch-table__toolbar__actions
  31. = 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') }
  32. = 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') }
  33. = 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') }
  34. = 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') }
  35. .batch-table__body
  36. - if @preview_cards.empty?
  37. = nothing_here 'nothing-here--under-tabs'
  38. - else
  39. = render partial: 'preview_card', collection: @preview_cards, locals: { f: f }
  40. = paginate @preview_cards