Implement UI for Admin Search of Hashtags (#30880)
This commit is contained in:
parent
6d2ed0dcba
commit
c40e481169
17 changed files with 316 additions and 11 deletions
27
app/views/admin/tags/_tag.html.haml
Normal file
27
app/views/admin/tags/_tag.html.haml
Normal file
|
@ -0,0 +1,27 @@
|
|||
.batch-table__row{ class: [!tag.requires_review? && !tag.usable? && 'batch-table__row--muted'] }
|
||||
.batch-table__row__content.batch-table__row__content--padded.pending-account
|
||||
.pending-account__header
|
||||
%strong
|
||||
= link_to tag.formatted_name, admin_tag_path(tag.id)
|
||||
|
||||
%br/
|
||||
|
||||
- if tag.usable?
|
||||
= t('admin.tags.moderation.usable')
|
||||
- else
|
||||
= t('admin.tags.moderation.not_usable')
|
||||
|
||||
·
|
||||
- if tag.trendable?
|
||||
= t('admin.tags.moderation.trendable')
|
||||
- else
|
||||
= t('admin.tags.moderation.not_trendable')
|
||||
|
||||
- if tag.requested_review? || tag.requires_review?
|
||||
·
|
||||
- if tag.requested_review?
|
||||
%span.negative-hint
|
||||
= t('admin.tags.moderation.review_requested')
|
||||
- else
|
||||
%span.warning-hint
|
||||
= t('admin.tags.moderation.pending_review')
|
39
app/views/admin/tags/index.html.haml
Normal file
39
app/views/admin/tags/index.html.haml
Normal file
|
@ -0,0 +1,39 @@
|
|||
- content_for :page_title do
|
||||
= t('admin.tags.title')
|
||||
|
||||
= form_with url: admin_tags_url, method: :get, class: :simple_form do |form|
|
||||
.filters
|
||||
.filter-subset.filter-subset--with-select
|
||||
%strong= t('admin.tags.moderation.title')
|
||||
.input.select.optional
|
||||
= form.select :status,
|
||||
options_for_select(admin_tags_moderation_options, params[:status]),
|
||||
prompt: t('generic.all')
|
||||
|
||||
.filter-subset.filter-subset--with-select
|
||||
%strong= t 'generic.order_by'
|
||||
.input.select
|
||||
= form.select :order,
|
||||
options_for_select([[t('admin.tags.newest'), 'newest'], [t('admin.tags.oldest'), 'oldest']], params[:order])
|
||||
|
||||
.fields-group
|
||||
.input.string.optional
|
||||
= form.text_field :name,
|
||||
value: params[:name],
|
||||
class: 'string optional',
|
||||
placeholder: t('admin.tags.name')
|
||||
|
||||
.actions
|
||||
%button.button= t('admin.tags.search')
|
||||
= link_to t('admin.tags.reset'), admin_tags_path, class: 'button negative'
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
.batch-table
|
||||
.batch-table__body
|
||||
- if @tags.empty?
|
||||
= nothing_here 'nothing-here--under-tabs'
|
||||
- else
|
||||
= render partial: 'tag', collection: @tags
|
||||
|
||||
= paginate @tags
|
|
@ -1,12 +1,13 @@
|
|||
- content_for :page_title do
|
||||
= "##{@tag.display_name}"
|
||||
= @tag.formatted_name
|
||||
|
||||
- if current_user.can?(:view_dashboard)
|
||||
- content_for :heading_actions do
|
||||
- content_for :heading_actions do
|
||||
- if current_user.can?(:view_dashboard)
|
||||
= l(@time_period.first)
|
||||
= ' - '
|
||||
= l(@time_period.last)
|
||||
|
||||
- if current_user.can?(:view_dashboard)
|
||||
.dashboard
|
||||
.dashboard__item
|
||||
= react_admin_component :counter,
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
|
||||
.batch-table__row__content.pending-account
|
||||
.pending-account__header
|
||||
= link_to admin_tag_path(tag.id) do
|
||||
= material_symbol 'tag'
|
||||
= tag.display_name
|
||||
= link_to tag.formatted_name, admin_tag_path(tag.id)
|
||||
|
||||
%br/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue