Various fixes and improvements (#12878)
* Fix unused role routes being generated * Remove unused JavaScript code * Refactor filters code to be DRYer * Fix `.count == 0` comparisons to `.empty?` in views * Fix filters in views
This commit is contained in:
@ -22,7 +22,7 @@
|
||||
|
||||
= form_tag admin_accounts_url, method: 'GET', class: 'simple_form' do
|
||||
.fields-group
|
||||
- Admin::FilterHelper::ACCOUNT_FILTERS.each do |key|
|
||||
- AccountFilter::KEYS.each do |key|
|
||||
- if params[key].present?
|
||||
= hidden_field_tag key, params[key]
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
= form_tag admin_custom_emojis_url, method: 'GET', class: 'simple_form' do
|
||||
.fields-group
|
||||
- Admin::FilterHelper::CUSTOM_EMOJI_FILTERS.each do |key|
|
||||
- CustomEmojiFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
- %i(shortcode by_domain).each do |key|
|
||||
@ -39,7 +39,7 @@
|
||||
= form_for(@form, url: batch_admin_custom_emojis_path) do |f|
|
||||
= hidden_field_tag :page, params[:page] || 1
|
||||
|
||||
- Admin::FilterHelper::CUSTOM_EMOJI_FILTERS.each do |key|
|
||||
- CustomEmojiFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
.batch-table
|
||||
|
@ -4,7 +4,7 @@
|
||||
- content_for :heading_actions do
|
||||
= link_to t('admin.email_domain_blocks.add_new'), new_admin_email_domain_block_path, class: 'button'
|
||||
|
||||
- if @email_domain_blocks.count == 0
|
||||
- if @email_domain_blocks.empty?
|
||||
%div.muted-hint.center-text=t 'admin.email_domain_blocks.empty'
|
||||
- else
|
||||
.table-wrapper
|
||||
|
@ -19,9 +19,8 @@
|
||||
- unless whitelist_mode?
|
||||
= form_tag admin_instances_url, method: 'GET', class: 'simple_form' do
|
||||
.fields-group
|
||||
- Admin::FilterHelper::INSTANCES_FILTERS.each do |key|
|
||||
- if params[key].present?
|
||||
= hidden_field_tag key, params[key]
|
||||
- InstanceFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
- %i(by_domain).each do |key|
|
||||
.input.string.optional
|
||||
|
@ -10,9 +10,8 @@
|
||||
|
||||
= form_tag admin_reports_url, method: 'GET', class: 'simple_form' do
|
||||
.fields-group
|
||||
- Admin::FilterHelper::REPORT_FILTERS.each do |key|
|
||||
- if params[key].present?
|
||||
= hidden_field_tag key, params[key]
|
||||
- ReportFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
- %i(by_target_domain).each do |key|
|
||||
.input.string.optional
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
= form_tag admin_tags_url, method: 'GET', class: 'simple_form' do
|
||||
.fields-group
|
||||
- Admin::FilterHelper::TAGS_FILTERS.each do |key|
|
||||
- TagFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
- %i(name).each do |key|
|
||||
@ -43,9 +43,8 @@
|
||||
|
||||
= form_for(@form, url: batch_admin_tags_path) do |f|
|
||||
= hidden_field_tag :page, params[:page] || 1
|
||||
= hidden_field_tag :name, params[:name] if params[:name].present?
|
||||
|
||||
- Admin::FilterHelper::TAGS_FILTERS.each do |key|
|
||||
- TagFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
.batch-table.optional
|
||||
|
@ -4,7 +4,7 @@
|
||||
- content_for :heading_actions do
|
||||
= link_to t('filters.new.title'), new_filter_path, class: 'button'
|
||||
|
||||
- if @filters.count == 0
|
||||
- if @filters.empty?
|
||||
%div.muted-hint.center-text= t 'filters.index.empty'
|
||||
- else
|
||||
.table-wrapper
|
||||
|
@ -33,10 +33,9 @@
|
||||
|
||||
= form_for(@form, url: relationships_path, method: :patch) do |f|
|
||||
= hidden_field_tag :page, params[:page] || 1
|
||||
= hidden_field_tag :relationship, params[:relationship]
|
||||
= hidden_field_tag :status, params[:status]
|
||||
= hidden_field_tag :activity, params[:activity]
|
||||
= hidden_field_tag :order, params[:order]
|
||||
|
||||
- RelationshipFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
|
||||
.batch-table
|
||||
.batch-table__toolbar
|
||||
|
@ -4,7 +4,7 @@
|
||||
- content_for :heading_actions do
|
||||
= link_to t('doorkeeper.applications.index.new'), new_settings_application_path, class: 'button'
|
||||
|
||||
- if @applications.count == 0
|
||||
- if @applications.empty?
|
||||
%div.muted-hint.center-text=t 'doorkeeper.applications.index.empty'
|
||||
- else
|
||||
.table-wrapper
|
||||
|
Reference in New Issue
Block a user