UX: shows a hint when there are more tags than displayed (#12649)

This commit is contained in:
Joffrey JAFFEUX
2021-04-08 15:51:31 +02:00
committed by GitHub
parent 7e2b7bdd78
commit 081ada090c
6 changed files with 66 additions and 6 deletions

View File

@@ -95,7 +95,9 @@ class Tag < ActiveRecord::Base
end
def self.top_tags(limit_arg: nil, category: nil, guardian: nil)
limit = limit_arg || SiteSetting.max_tags_in_filter_list
# we add 1 to max_tags_in_filter_list to efficiently know we have more tags
# than the limit. Frontend is responsible to enforce limit.
limit = limit_arg || (SiteSetting.max_tags_in_filter_list + 1)
scope_category_ids = (guardian || Guardian.new).allowed_category_ids
if category