diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2020-01-20 15:55:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-20 15:55:03 +0100 |
commit | 6feafb8802b2759eb33968a70b6c1cb100bf3926 (patch) | |
tree | 5df6ee7f77b92dec9ab6e848ec663b9f4b5838c4 /app/helpers/admin | |
parent | 06f6995860d507ac26f23722506420b5cdae2ffe (diff) |
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
Diffstat (limited to 'app/helpers/admin')
-rw-r--r-- | app/helpers/admin/filter_helper.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/helpers/admin/filter_helper.rb b/app/helpers/admin/filter_helper.rb index fc4f15985..130686a02 100644 --- a/app/helpers/admin/filter_helper.rb +++ b/app/helpers/admin/filter_helper.rb @@ -1,15 +1,15 @@ # frozen_string_literal: true module Admin::FilterHelper - ACCOUNT_FILTERS = %i(local remote by_domain active pending silenced suspended username display_name email ip staff).freeze - REPORT_FILTERS = %i(resolved account_id target_account_id by_target_domain).freeze - INVITE_FILTER = %i(available expired).freeze - CUSTOM_EMOJI_FILTERS = %i(local remote by_domain shortcode).freeze - TAGS_FILTERS = %i(directory reviewed unreviewed pending_review popular active name).freeze - INSTANCES_FILTERS = %i(limited by_domain).freeze - FOLLOWERS_FILTERS = %i(relationship status by_domain activity order).freeze - - FILTERS = ACCOUNT_FILTERS + REPORT_FILTERS + INVITE_FILTER + CUSTOM_EMOJI_FILTERS + TAGS_FILTERS + INSTANCES_FILTERS + FOLLOWERS_FILTERS + FILTERS = [ + AccountFilter::KEYS, + CustomEmojiFilter::KEYS, + ReportFilter::KEYS, + TagFilter::KEYS, + InstanceFilter::KEYS, + InviteFilter::KEYS, + RelationshipFilter::KEYS, + ].flatten.freeze def filter_link_to(text, link_to_params, link_class_params = link_to_params) new_url = filtered_url_for(link_to_params) |