From 7942abf11af1ecd9923be13845ada25f11968cb7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 26 Oct 2020 21:05:15 +0000 Subject: [PATCH] Don't show rss icons if there is no content --- webinterface.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/webinterface.py b/webinterface.py index 71df392fc..94b681d3e 100644 --- a/webinterface.py +++ b/webinterface.py @@ -5572,6 +5572,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str, htmlStr += '
\n' linksFilename = baseDir + '/accounts/links.txt' + linksFileContainsEntries = False if os.path.isfile(linksFilename): linksList = None with open(linksFilename, "r") as f: @@ -5605,6 +5606,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str, htmlStr += \ '

' + \ lineStr + '

\n' + linksFileContainsEntries = True else: if lineStr.startswith('#') or lineStr.startswith('*'): lineStr = lineStr[1:].strip() @@ -5614,8 +5616,9 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str, else: htmlStr += \ '

' + lineStr + '

\n' + linksFileContainsEntries = True - if not rssIconAtTop: + if linksFileContainsEntries and not rssIconAtTop: htmlStr += '
' + rssIconStr return htmlStr @@ -5808,10 +5811,12 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str, else: htmlStr += '
\n' - htmlStr += htmlNewswire(newswire, nickname, moderator, translate, - positiveVoting, iconsDir) + newswireContentStr = \ + htmlNewswire(newswire, nickname, moderator, translate, + positiveVoting, iconsDir) + htmlStr += newswireContentStr - if not rssIconAtTop: + if newswireContentStr and not rssIconAtTop: htmlStr += '
' + rssIconStr return htmlStr