Show post author

master
Bob Mottram 2019-07-21 13:41:31 +01:00
parent 314a3aa047
commit 39bfc07ac5
2 changed files with 39 additions and 29 deletions

View File

@ -54,3 +54,8 @@ body {
float: left; float: left;
color: #999; color: #999;
} }
.post-title {
margin-top: 0px;
color: #999;
}

View File

@ -7,6 +7,8 @@ __email__ = "bob@freedombone.net"
__status__ = "Production" __status__ = "Production"
import json import json
from utils import getNicknameFromActor
from utils import getDomainFromActor
def htmlHeader(lang='en') -> str: def htmlHeader(lang='en') -> str:
htmlStr= \ htmlStr= \
@ -72,10 +74,13 @@ 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>'+ \
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'+ \