Use `async_count` in more view locations (#32086)
parent
77f5b127fa
commit
4fe7f213a6
|
@ -6,6 +6,7 @@ class Admin::AnnouncementsController < Admin::BaseController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
authorize :announcement, :index?
|
authorize :announcement, :index?
|
||||||
|
@published_announcements_count = Announcement.published.async_count
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|
|
@ -6,6 +6,7 @@ class Admin::Disputes::AppealsController < Admin::BaseController
|
||||||
def index
|
def index
|
||||||
authorize :appeal, :index?
|
authorize :appeal, :index?
|
||||||
|
|
||||||
|
@pending_appeals_count = Appeal.pending.async_count
|
||||||
@appeals = filtered_appeals.page(params[:page])
|
@appeals = filtered_appeals.page(params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ class Admin::Trends::Links::PreviewCardProvidersController < Admin::BaseControll
|
||||||
def index
|
def index
|
||||||
authorize :preview_card_provider, :review?
|
authorize :preview_card_provider, :review?
|
||||||
|
|
||||||
|
@pending_preview_card_providers_count = PreviewCardProvider.unreviewed.async_count
|
||||||
@preview_card_providers = filtered_preview_card_providers.page(params[:page])
|
@preview_card_providers = filtered_preview_card_providers.page(params[:page])
|
||||||
@form = Trends::PreviewCardProviderBatch.new
|
@form = Trends::PreviewCardProviderBatch.new
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,6 +4,7 @@ class Admin::Trends::TagsController < Admin::BaseController
|
||||||
def index
|
def index
|
||||||
authorize :tag, :review?
|
authorize :tag, :review?
|
||||||
|
|
||||||
|
@pending_tags_count = Tag.pending_review.async_count
|
||||||
@tags = filtered_tags.page(params[:page])
|
@tags = filtered_tags.page(params[:page])
|
||||||
@form = Trends::TagBatch.new
|
@form = Trends::TagBatch.new
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
%strong= t('admin.relays.status')
|
%strong= t('admin.relays.status')
|
||||||
%ul
|
%ul
|
||||||
%li= filter_link_to t('generic.all'), published: nil, unpublished: nil
|
%li= filter_link_to t('generic.all'), published: nil, unpublished: nil
|
||||||
%li= filter_link_to safe_join([t('admin.announcements.live'), "(#{number_with_delimiter(Announcement.published.count)})"], ' '), published: '1', unpublished: nil
|
%li= filter_link_to safe_join([t('admin.announcements.live'), "(#{number_with_delimiter(@published_announcements_count.value)})"], ' '), published: '1', unpublished: nil
|
||||||
|
|
||||||
- if @announcements.empty?
|
- if @announcements.empty?
|
||||||
.muted-hint.center-text
|
.muted-hint.center-text
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
.filter-subset
|
.filter-subset
|
||||||
%strong= t('admin.tags.review')
|
%strong= t('admin.tags.review')
|
||||||
%ul
|
%ul
|
||||||
%li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{Appeal.pending.count})"], ' '), status: 'pending'
|
%li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{@pending_appeals_count.value})"], ' '), status: 'pending'
|
||||||
%li= filter_link_to t('admin.trends.approved'), status: 'approved'
|
%li= filter_link_to t('admin.trends.approved'), status: 'approved'
|
||||||
%li= filter_link_to t('admin.trends.rejected'), status: 'rejected'
|
%li= filter_link_to t('admin.trends.rejected'), status: 'rejected'
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
%li= filter_link_to t('generic.all'), status: nil
|
%li= filter_link_to t('generic.all'), status: nil
|
||||||
%li= filter_link_to t('admin.trends.approved'), status: 'approved'
|
%li= filter_link_to t('admin.trends.approved'), status: 'approved'
|
||||||
%li= filter_link_to t('admin.trends.rejected'), status: 'rejected'
|
%li= filter_link_to t('admin.trends.rejected'), status: 'rejected'
|
||||||
%li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{PreviewCardProvider.unreviewed.count})"], ' '), status: 'pending_review'
|
%li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{@pending_preview_card_providers_count.value})"], ' '), status: 'pending_review'
|
||||||
.back-link
|
.back-link
|
||||||
= link_to admin_trends_links_path do
|
= link_to admin_trends_links_path do
|
||||||
= material_symbol 'chevron_left'
|
= material_symbol 'chevron_left'
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
%li= filter_link_to t('generic.all'), status: nil
|
%li= filter_link_to t('generic.all'), status: nil
|
||||||
%li= filter_link_to t('admin.trends.approved'), status: 'approved'
|
%li= filter_link_to t('admin.trends.approved'), status: 'approved'
|
||||||
%li= filter_link_to t('admin.trends.rejected'), status: 'rejected'
|
%li= filter_link_to t('admin.trends.rejected'), status: 'rejected'
|
||||||
%li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{Tag.pending_review.count})"], ' '), status: 'pending_review'
|
%li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{@pending_tags_count.value})"], ' '), status: 'pending_review'
|
||||||
|
|
||||||
= form_with model: @form, url: batch_admin_trends_tags_path do |f|
|
= form_with model: @form, url: batch_admin_trends_tags_path do |f|
|
||||||
= hidden_field_tag :page, params[:page] || 1
|
= hidden_field_tag :page, params[:page] || 1
|
||||||
|
|
Loading…
Reference in New Issue