about summary refs log tree commit diff
path: root/app/views/admin/tags/index.html.haml
blob: 324d13d3e7747348fa77e3a30a5f4da0ddb316d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
- content_for :page_title do
  = t('admin.tags.title')

- content_for :header_tags do
  = javascript_pack_tag 'admin', integrity: true, async: true, crossorigin: 'anonymous'

.filters
  .filter-subset
    %strong= t('admin.tags.context')
    %ul
      %li= filter_link_to t('generic.all'), context: nil
      %li= filter_link_to t('admin.tags.directory'), context: 'directory'

  .filter-subset
    %strong= t('admin.tags.review')
    %ul
      %li= filter_link_to t('generic.all'), review: nil
      %li= filter_link_to t('admin.tags.unreviewed'), review: 'unreviewed'
      %li= filter_link_to t('admin.tags.reviewed'), review: 'reviewed'
      %li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{Tag.pending_review.count})"], ' '), review: 'pending_review'

%hr.spacer/

= form_for(@form, url: batch_admin_tags_path) do |f|
  = hidden_field_tag :page, params[:page] || 1
  = hidden_field_tag :context, params[:context]
  = hidden_field_tag :review, params[:review]

  .batch-table
    .batch-table__toolbar
      %label.batch-table__toolbar__select.batch-checkbox-all
        = check_box_tag :batch_checkbox_all, nil, false
      .batch-table__toolbar__actions
        - if params[:review] == 'pending_review'
          = 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') }

          = 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') }
        - else
          %span.neutral-hint= t('generic.no_batch_actions_available')

    .batch-table__body
      - if @tags.empty?
        = nothing_here 'nothing-here--under-tabs'
      - else
        = render partial: 'tag', collection: @tags, locals: { f: f }

= paginate @tags

- if params[:review] == 'pending_review'
  %hr.spacer/

  %div{ style: 'overflow: hidden' }
    %div{ style: 'float: right' }
      = 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'

    %div
      = link_to t('admin.accounts.approve_all'), approve_all_admin_tags_path, method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button'