From a1b2bcd5b6fe2e828cf4fdfc290c56a260f5ab9a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 6 Nov 2020 13:50:23 +0000 Subject: [PATCH] Append citations to blog posts --- webinterface.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/webinterface.py b/webinterface.py index 99553e79a..6528b6a6c 100644 --- a/webinterface.py +++ b/webinterface.py @@ -5583,6 +5583,27 @@ def individualPostAsHtml(allowDownloads: bool, '
' + contentStr + \
                 '
\n' + # show blog citations + citationsStr = '' + if boxName == 'tlblog': + if postJsonObject['object'].get('tag'): + for tagJson in postJsonObject['object']['tag']: + if not tagJson.get('type'): + continue + if tagJson['type'] != 'Article': + continue + if not tagJson.get('name'): + continue + if not tagJson.get('url'): + continue + citationsStr += \ + '
  • ' + \ + '' + tagJson['name'] + '
  • \n' + if citationsStr: + citationsStr = '

    ' + translate['Citations'] + \ + ':

    ' + \ + '\n' + postHtml = '' if boxName != 'tlmedia': postHtml = '
    \n' + \ ' ' + titleStr + \ replyAvatarImageInPost + '
    \n' - postHtml += contentStr + footerStr + '\n' + postHtml += contentStr + citationsStr + footerStr + '\n' postHtml += ' \n' else: postHtml = galleryStr