forked from indymedia/epicyon
Link back to reply
parent
39bfc07ac5
commit
f8cee3f847
|
@ -46,10 +46,19 @@ def individualPostAsHtml(postJsonObject: {}) -> str:
|
||||||
avatarPosition=''
|
avatarPosition=''
|
||||||
containerClass='container'
|
containerClass='container'
|
||||||
timeClass='time-right'
|
timeClass='time-right'
|
||||||
|
nickname=getNicknameFromActor(postJsonObject['actor'])
|
||||||
|
domain,port=getDomainFromActor(postJsonObject['actor'])
|
||||||
|
titleStr='@'+nickname+'@'+domain
|
||||||
if postJsonObject['object']['inReplyTo']:
|
if postJsonObject['object']['inReplyTo']:
|
||||||
containerClass='container darker'
|
containerClass='container darker'
|
||||||
avatarPosition=' class="right"'
|
avatarPosition=' class="right"'
|
||||||
timeClass='time-left'
|
timeClass='time-left'
|
||||||
|
if '/statuses/' in postJsonObject['object']['inReplyTo']:
|
||||||
|
replyNickname=getNicknameFromActor(postJsonObject['object']['inReplyTo'])
|
||||||
|
replyDomain,replyPort=getDomainFromActor(postJsonObject['object']['inReplyTo'])
|
||||||
|
titleStr+=' <i>replying to</i> <a href="'+postJsonObject['object']['inReplyTo']+'">@'+replyNickname+'@'+replyDomain+'</a>'
|
||||||
|
else:
|
||||||
|
titleStr+=' <i>replying to</i> '+postJsonObject['object']['inReplyTo']
|
||||||
attachmentStr=''
|
attachmentStr=''
|
||||||
if postJsonObject['object']['attachment']:
|
if postJsonObject['object']['attachment']:
|
||||||
if isinstance(postJsonObject['object']['attachment'], list):
|
if isinstance(postJsonObject['object']['attachment'], list):
|
||||||
|
@ -74,13 +83,11 @@ def individualPostAsHtml(postJsonObject: {}) -> str:
|
||||||
'<img src="'+attach['url']+'" alt="'+imageDescription+'" title="'+imageDescription+'" class="attachment"></a>\n'
|
'<img src="'+attach['url']+'" alt="'+imageDescription+'" title="'+imageDescription+'" class="attachment"></a>\n'
|
||||||
attachmentCtr+=1
|
attachmentCtr+=1
|
||||||
|
|
||||||
nickname=getNicknameFromActor(postJsonObject['actor'])
|
|
||||||
domain,port=getDomainFromActor(postJsonObject['actor'])
|
|
||||||
return \
|
return \
|
||||||
'<div class="'+containerClass+'">\n' \
|
'<div class="'+containerClass+'">\n' \
|
||||||
'<a href="'+postJsonObject['actor']+'">' \
|
'<a href="'+postJsonObject['actor']+'">' \
|
||||||
'<img src="'+postJsonObject['actor']+'/avatar.png" alt="Avatar"'+avatarPosition+'></a>\n'+ \
|
'<img src="'+postJsonObject['actor']+'/avatar.png" alt="Avatar"'+avatarPosition+'></a>\n'+ \
|
||||||
'<p class="post-title">@'+nickname+'@'+domain+'</p>'+ \
|
'<p class="post-title">'+titleStr+'</p>'+ \
|
||||||
postJsonObject['object']['content']+'\n'+ \
|
postJsonObject['object']['content']+'\n'+ \
|
||||||
attachmentStr+ \
|
attachmentStr+ \
|
||||||
'<span class="'+timeClass+'">'+postJsonObject['object']['published']+'</span>\n'+ \
|
'<span class="'+timeClass+'">'+postJsonObject['object']['published']+'</span>\n'+ \
|
||||||
|
|
Loading…
Reference in New Issue