move Activities section into an admin page for easy editing

This commit is contained in:
2022-05-17 18:28:17 +02:00
parent 0e196b2e21
commit fa26947461
12 changed files with 65 additions and 52 deletions

View File

@@ -93,6 +93,24 @@ def blog_edit(request):
def blog_search(request):
criteria = ''
liste = ''
# generate a list of all tags of all topics
if request.authenticated_userid:
# get all topics
topics = BlogRecordService.get_topics(request)
for topic in topics:
liste += '<h4>' + topic.topic_name + '</h4>'
# 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(
tag.tag_name, count)
liste += '</ul>'
form = BlogSearchForm(request.POST)
items = []
if 'form.submitted' in request.params and form.validate():
@@ -105,6 +123,7 @@ def blog_search(request):
'form': form,
'items': items,
'criteria': criteria,
'liste': liste,
}