All tags under button

main
Bob Mottram 2020-12-02 20:15:01 +00:00
parent fcabcabb8f
commit 8960aaccdf
1 changed files with 12 additions and 6 deletions

View File

@ -10,6 +10,7 @@ import os
from datetime import datetime
from utils import getHashtagCategories
from utils import getHashtagCategory
from webapp_utils import getContentWarningButton
def getHashtagCategoriesFeed(baseDir: str,
@ -197,6 +198,7 @@ def htmlHashTagSwarm(baseDir: str, actor: str, translate: {}) -> str:
# swarm of categories
categorySwarmStr = ''
if categorySwarm:
if len(categorySwarm) > 3:
categorySwarm.sort()
for categoryStr in categorySwarm:
categorySwarmStr += \
@ -211,6 +213,10 @@ def htmlHashTagSwarm(baseDir: str, actor: str, translate: {}) -> str:
'<a href="' + actor + '/tags/' + tagName + \
'" class="hashtagswarm">' + tagName + '</a>\n'
if categorySwarmStr:
tagSwarmStr = \
getContentWarningButton('alltags', translate, tagSwarmStr)
tagSwarmHtml = categorySwarmStr + tagSwarmStr.strip() + '\n'
tagSwarmHtml += getHashtagDomainHistogram(domainHistogram, translate)
return tagSwarmHtml