<commit_before>- 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'), directory: nil
      %li= filter_link_to t('admin.tags.directory'), directory: '1'

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

  .filter-subset
    %strong= t('generic.order_by')
    %ul
      %li= filter_link_to t('admin.tags.most_recent'), popular: nil, active: nil
      %li= filter_link_to t('admin.tags.most_popular'), popular: '1', active: nil
      %li= filter_link_to t('admin.tags.last_active'), active: '1', popular: nil

= form_tag admin_tags_url, method: 'GET', class: 'simple_form' do
  .fields-group
    - Admin::FilterHelper::TAGS_FILTERS.each do |key|
      = hidden_field_tag key, params[key] if params[key].present?

    - %i(name).each do |key|
      .input.string.optional
        = text_field_tag key, params[key], class: 'string optional', placeholder: I18n.t("admin.tags.#{key}")

    .actions
      %button= t('admin.accounts.search')
      = link_to t('admin.accounts.reset'), admin_tags_path, class: 'button negative'

%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<commit_msg>Fix hashtag batch actions being unavailable on pending review page (#11897)<commit_after>- 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'), directory: nil
      %li= filter_link_to t('admin.tags.directory'), directory: '1'

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

  .filter-subset
    %strong= t('generic.order_by')
    %ul
      %li= filter_link_to t('admin.tags.most_recent'), popular: nil, active: nil
      %li= filter_link_to t('admin.tags.most_popular'), popular: '1', active: nil
      %li= filter_link_to t('admin.tags.last_active'), active: '1', popular: nil

= form_tag admin_tags_url, method: 'GET', class: 'simple_form' do
  .fields-group
    - Admin::FilterHelper::TAGS_FILTERS.each do |key|
      = hidden_field_tag key, params[key] if params[key].present?

    - %i(name).each do |key|
      .input.string.optional
        = text_field_tag key, params[key], class: 'string optional', placeholder: I18n.t("admin.tags.#{key}")

    .actions
      %button= t('admin.accounts.search')
      = link_to t('admin.accounts.reset'), admin_tags_path, class: 'button negative'

%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[:pending_review] == '1'
          = 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
{'fraction_non_alphanumeric': 0.1552, 'fraction_numerical': 0.004266666666666667, 'mean_word_length': 3.9394205443371377, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4651870', 'n_tokens_mistral': 1925, 'n_tokens_neox': 1873, 'n_words': 397}