From a7c94a006a6b3f14e5ed5ee9ea1235382986dfa1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 5 Oct 2020 12:40:59 +0000 Subject: [PATCH] Simplify --- webinterface.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/webinterface.py b/webinterface.py index 09ded6c83..bd702a5d8 100644 --- a/webinterface.py +++ b/webinterface.py @@ -5342,16 +5342,18 @@ def htmlNewswire(newswire: str) -> str: """ htmlStr = '' for dateStr, item in newswire.items(): - if len(item) == 2: - htmlStr += '

' + \ - '' + item[0] + '' - elif len(item) > 2: + # if the item is to be moderated then show it in a different style + shown = False + if len(item) > 2: if item[2].startswith('moderate'): htmlStr += '

' + \ '' + item[0] + '' - else: - htmlStr += '

' + \ - '' + item[0] + '' + shown = True + + if not shown: + # unmoderated item + htmlStr += '

' + \ + '' + item[0] + '' htmlStr += '

' return htmlStr