main
Bob Mottram 2020-10-05 12:40:59 +00:00
parent 94c2bd819e
commit a7c94a006a
1 changed files with 9 additions and 7 deletions

View File

@ -5342,16 +5342,18 @@ def htmlNewswire(newswire: str) -> str:
""" """
htmlStr = '' htmlStr = ''
for dateStr, item in newswire.items(): for dateStr, item in newswire.items():
if len(item) == 2: # if the item is to be moderated then show it in a different style
htmlStr += '<p class="newswireItem">' + \ shown = False
'<a href="' + item[1] + '">' + item[0] + '</a>' if len(item) > 2:
elif len(item) > 2:
if item[2].startswith('moderate'): if item[2].startswith('moderate'):
htmlStr += '<p class="newswireItemModerate">' + \ htmlStr += '<p class="newswireItemModerate">' + \
'<a href="' + item[1] + '">' + item[0] + '</a>' '<a href="' + item[1] + '">' + item[0] + '</a>'
else: shown = True
htmlStr += '<p class="newswireItem">' + \
'<a href="' + item[1] + '">' + item[0] + '</a>' if not shown:
# unmoderated item
htmlStr += '<p class="newswireItem">' + \
'<a href="' + item[1] + '">' + item[0] + '</a>'
htmlStr += ' <label class="newswireDate">' htmlStr += ' <label class="newswireDate">'
htmlStr += dateStr.replace('+00:00', '') + '</label></p>' htmlStr += dateStr.replace('+00:00', '') + '</label></p>'
return htmlStr return htmlStr