added link to topic

This commit is contained in:
2022-05-18 21:26:17 +02:00
parent 62371401c5
commit 9c61a8e98b

View File

@@ -100,14 +100,16 @@ def blog_search(request):
topics = BlogRecordService.get_topics(request)
for topic in topics:
liste += '<h4>' + topic.topic_name + '</h4>'
liste += '<h4><a href="{0}">{1}</a></h4>'.format(
request.route_url('topic', topic=topic.topic), topic.topic_name)
# get all the tags of the topic
tags = BlogRecordService.get_tags_byTopic(request, topic.topic)
if tags:
liste += '<ul>'
for tag in tags:
count = len(BlogRecordService.by_topic(request, tag.topic, tag.tag))
liste += '<button type="button" class="btn">{0} <span class="badge">{1}</span></button>&nbsp;'.format(
liste += '<button type="button" class="btn">{0}&nbsp;&nbsp;&nbsp;<span class="badge">{1}</span></button>&nbsp;'.format(
tag.tag_name, count)
liste += '</ul>'