Announce icon

master
Bob Mottram 2019-08-22 10:23:04 +01:00
parent 376fa17853
commit cc38d8cc62
2 changed files with 26 additions and 19 deletions

View File

@ -394,6 +394,10 @@ a:link {
color: var(--main-fg-color); color: var(--main-fg-color);
} }
.announce {
width: 50px;
}
.darker { .darker {
background-color: var(--main-bg-color-reply); background-color: var(--main-bg-color-reply);
} }

View File

@ -1124,26 +1124,29 @@ def individualPostAsHtml(baseDir: str, \
messageId=postJsonObject['id'].replace('/activity','') messageId=postJsonObject['id'].replace('/activity','')
titleStr+='<a href="'+messageId+'">@'+actorNickname+'@'+actorDomain+'</a>' titleStr+='<a href="'+messageId+'">@'+actorNickname+'@'+actorDomain+'</a>'
if isAnnounced and postJsonObject['object'].get('attributedTo'): if isAnnounced:
announceNickname=getNicknameFromActor(postJsonObject['object']['attributedTo']) if postJsonObject['object'].get('attributedTo'):
announceDomain,announcePort=getDomainFromActor(postJsonObject['object']['attributedTo']) announceNickname=getNicknameFromActor(postJsonObject['object']['attributedTo'])
titleStr+=' <i class="replyingto">announced</i> <a href="'+postJsonObject['object']['id']+'">@'+announceNickname+'@'+announceDomain+'</a>' announceDomain,announcePort=getDomainFromActor(postJsonObject['object']['attributedTo'])
titleStr+=' <img src="/icons/repeat_inactive.png" class="announce"/> <a href="'+postJsonObject['object']['id']+'">@'+announceNickname+'@'+announceDomain+'</a>'
if not isAnnounced and postJsonObject['object'].get('inReplyTo'):
containerClassIcons='containericons darker'
containerClass='container darker'
avatarPosition=' class="right"'
#timeClass='time-left'
if '/statuses/' in postJsonObject['object']['inReplyTo']:
replyNickname=getNicknameFromActor(postJsonObject['object']['inReplyTo'])
replyDomain,replyPort=getDomainFromActor(postJsonObject['object']['inReplyTo'])
if replyNickname and replyDomain:
titleStr+=' <i class="replyingto">replying to</i> <a href="'+postJsonObject['object']['inReplyTo']+'">@'+replyNickname+'@'+replyDomain+'</a>'
else: else:
postDomain=postJsonObject['object']['inReplyTo'].replace('https://','').replace('http://','').replace('dat://','') titleStr+=' <img src="/icons/repeat_inactive.png" class="announce"/> <a href="'+postJsonObject['object']['id']+'">@unattributed</a>'
if '/' in postDomain: else:
postDomain=postDomain.split('/',1)[0] if postJsonObject['object'].get('inReplyTo'):
titleStr+=' <i class="replyingto">replying to</i> <a href="'+postJsonObject['object']['inReplyTo']+'">'+postDomain+'</a>' containerClassIcons='containericons darker'
containerClass='container darker'
avatarPosition=' class="right"'
#timeClass='time-left'
if '/statuses/' in postJsonObject['object']['inReplyTo']:
replyNickname=getNicknameFromActor(postJsonObject['object']['inReplyTo'])
replyDomain,replyPort=getDomainFromActor(postJsonObject['object']['inReplyTo'])
if replyNickname and replyDomain:
titleStr+=' <i class="replyingto">replying to</i> <a href="'+postJsonObject['object']['inReplyTo']+'">@'+replyNickname+'@'+replyDomain+'</a>'
else:
postDomain=postJsonObject['object']['inReplyTo'].replace('https://','').replace('http://','').replace('dat://','')
if '/' in postDomain:
postDomain=postDomain.split('/',1)[0]
titleStr+=' <i class="replyingto">replying to</i> <a href="'+postJsonObject['object']['inReplyTo']+'">'+postDomain+'</a>'
attachmentStr='' attachmentStr=''
if postJsonObject['object']['attachment']: if postJsonObject['object']['attachment']:
if isinstance(postJsonObject['object']['attachment'], list): if isinstance(postJsonObject['object']['attachment'], list):