added status to blog post

This commit is contained in:
2022-05-18 14:38:30 +02:00
parent 7fa1595f0a
commit 62371401c5
9 changed files with 85 additions and 28 deletions

View File

@@ -150,12 +150,16 @@ def topic(request):
# lire toutes les docs du topic
items = BlogRecordService.by_topic(request, topic, tag.tag)
if items:
liste += '<ul>'
liste += '<ul><table class="table table-condensed">'
for item in items:
liste += '<li><a href="{0}">{1}</a> — {2}, {3}</li>'.format(
request.route_url('blog', id=item.id, slug=item.slug), item.title, item.author,
item.created.strftime("%d-%m-%Y"))
liste += '</ul>'
liste += '<tr>'
liste += '<td><a href="%s">%s</a></td>' % (request.route_url('blog', id=item.id, slug=item.slug), item.title)
liste += '<td>%s</td>' % item.author
liste += '<td>%s</td>' % item.created.strftime("%d-%m-%Y")
if item.status == 'brouillon':
liste += '<td><span class="label label-danger">%s</span></td>' % item.status
liste += '</tr>'
liste += '</table></ul>'
else:
liste += '<ul><li> </li></ul>'
return {