The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

80 lines
3.3 KiB

  1. - content_for :page_title do
  2. = t('admin.tags.title')
  3. - content_for :header_tags do
  4. = javascript_pack_tag 'admin', integrity: true, async: true, crossorigin: 'anonymous'
  5. .filters
  6. .filter-subset
  7. %strong= t('admin.tags.context')
  8. %ul
  9. %li= filter_link_to t('generic.all'), directory: nil
  10. %li= filter_link_to t('admin.tags.directory'), directory: '1'
  11. .filter-subset
  12. %strong= t('admin.tags.review')
  13. %ul
  14. %li= filter_link_to t('generic.all'), reviewed: nil, unreviewed: nil, pending_review: nil
  15. %li= filter_link_to t('admin.tags.unreviewed'), unreviewed: '1', reviewed: nil, pending_review: nil
  16. %li= filter_link_to t('admin.tags.reviewed'), reviewed: '1', unreviewed: nil, pending_review: nil
  17. %li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{Tag.pending_review.count})"], ' '), pending_review: '1', reviewed: nil, unreviewed: nil
  18. .filter-subset
  19. %strong= t('generic.order_by')
  20. %ul
  21. %li= filter_link_to t('admin.tags.most_recent'), popular: nil, active: nil
  22. %li= filter_link_to t('admin.tags.most_popular'), popular: '1', active: nil
  23. %li= filter_link_to t('admin.tags.last_active'), active: '1', popular: nil
  24. = form_tag admin_tags_url, method: 'GET', class: 'simple_form' do
  25. .fields-group
  26. - Admin::FilterHelper::TAGS_FILTERS.each do |key|
  27. = hidden_field_tag key, params[key] if params[key].present?
  28. - %i(name).each do |key|
  29. .input.string.optional
  30. = text_field_tag key, params[key], class: 'string optional', placeholder: I18n.t("admin.tags.#{key}")
  31. .actions
  32. %button= t('admin.accounts.search')
  33. = link_to t('admin.accounts.reset'), admin_tags_path, class: 'button negative'
  34. %hr.spacer/
  35. = form_for(@form, url: batch_admin_tags_path) do |f|
  36. = hidden_field_tag :page, params[:page] || 1
  37. = hidden_field_tag :name, params[:name] if params[:name].present?
  38. - Admin::FilterHelper::TAGS_FILTERS.each do |key|
  39. = hidden_field_tag key, params[key] if params[key].present?
  40. .batch-table.optional
  41. .batch-table__toolbar
  42. %label.batch-table__toolbar__select.batch-checkbox-all
  43. = check_box_tag :batch_checkbox_all, nil, false
  44. .batch-table__toolbar__actions
  45. - if params[:pending_review] == '1'
  46. = f.button safe_join([fa_icon('check'), t('admin.accounts.approve')]), name: :approve, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  47. = f.button safe_join([fa_icon('times'), t('admin.accounts.reject')]), name: :reject, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  48. - else
  49. %span.neutral-hint= t('generic.no_batch_actions_available')
  50. .batch-table__body
  51. - if @tags.empty?
  52. = nothing_here 'nothing-here--under-tabs'
  53. - else
  54. = render partial: 'tag', collection: @tags, locals: { f: f }
  55. = paginate @tags
  56. - if params[:pending_review] == '1'
  57. %hr.spacer/
  58. %div{ style: 'overflow: hidden' }
  59. %div{ style: 'float: right' }
  60. = link_to t('admin.accounts.reject_all'), reject_all_admin_tags_path, method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button button--destructive'
  61. %div
  62. = link_to t('admin.accounts.approve_all'), approve_all_admin_tags_path, method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button'