Show moderatable newswire items in a different color

merge-requests/8/head
Bob Mottram 2020-10-09 14:08:06 +01:00
parent e0ec134810
commit 1a284f3567
2 changed files with 25 additions and 5 deletions

View File

@ -68,6 +68,8 @@
--quote-font-size: 120%;
--line-spacing: 130%;
--line-spacing-newswire: 100%;
--newswire-item-moderated-color: green;
--newswire-date-moderated-color: lightgreen;
--column-left-width: 10vw;
--column-center-width: 80vw;
--column-right-width: 10vw;
@ -233,6 +235,19 @@ a:focus {
line-height: var(--line-spacing-newswire);
}
.newswireItemModerated {
font-size: var(--font-size-newswire);
color: var(--newswire-item-moderated-color);
line-height: var(--line-spacing-newswire);
}
.newswireDateModerated {
font-size: var(--font-size-newswire);
font-weight: bold;
color: var(--newswire-date-moderated-color);
float: right;
}
.newswireItemVotedOn a:link {
background: var(--newswire-voted-background-color);
}

View File

@ -5416,25 +5416,30 @@ def htmlNewswire(newswire: str, nickname: str, moderator: bool,
else:
totalVotesStr = ''
totalVotes = 0
moderatedItem = False
if moderator:
moderatedItem = item[5]
totalVotes = votesOnNewswireItem(item[2])
# show a number of ticks or crosses for how many
# votes for or against
totalVotesStr = \
votesIndicator(totalVotes, positiveVoting)
htmlStr += '<p class="newswireItem">' + \
'<a href="' + item[1] + '">' + item[0] + '</a>' + \
totalVotesStr
if moderator:
if moderator and moderatedItem:
htmlStr += '<p class="newswireItemModerated">' + \
'<a href="' + item[1] + '">' + item[0] + '</a>' + \
totalVotesStr
htmlStr += \
' ' + \
'<a href="/users/' + nickname + \
'/newswirevote=' + dateStrLink + '" ' + \
'title="' + translate['Vote'] + '">' + \
'<label class="newswireDate">'
'<label class="newswireDateModerated">'
htmlStr += dateStr.replace('+00:00', '') + '</label></a></p>'
else:
htmlStr += '<p class="newswireItem">' + \
'<a href="' + item[1] + '">' + item[0] + '</a>' + \
totalVotesStr
htmlStr += ' <label class="newswireDate">'
htmlStr += dateStr.replace('+00:00', '') + '</label></p>'
return htmlStr