media div

master
Bob Mottram 2019-08-20 16:38:24 +01:00
parent 0e87e2f777
commit 5373d1aa30
2 changed files with 8 additions and 2 deletions

View File

@ -322,6 +322,12 @@ a:link {
margin: 10px 0; margin: 10px 0;
} }
.media {
border-radius: 5px;
padding: 10px;
margin: 10px 0;
}
.container p.administeredby { .container p.administeredby {
font-size: 18px; font-size: 18px;
} }

View File

@ -1107,6 +1107,7 @@ def individualPostAsHtml(baseDir: str, \
if postJsonObject['object']['attachment']: if postJsonObject['object']['attachment']:
if isinstance(postJsonObject['object']['attachment'], list): if isinstance(postJsonObject['object']['attachment'], list):
attachmentCtr=0 attachmentCtr=0
attachmentStr+='<div class="media">'
for attach in postJsonObject['object']['attachment']: for attach in postJsonObject['object']['attachment']:
if attach.get('mediaType') and attach.get('url'): if attach.get('mediaType') and attach.get('url'):
mediaType=attach['mediaType'] mediaType=attach['mediaType']
@ -1126,8 +1127,7 @@ def individualPostAsHtml(baseDir: str, \
'<a href="'+attach['url']+'">' \ '<a href="'+attach['url']+'">' \
'<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
if attachmentCtr>0: attachmentStr+='</div>'
attachmentStr+='<br>'
if not avatarUrl: if not avatarUrl:
avatarUrl=getPersonAvatarUrl(baseDir,postJsonObject['actor'],personCache) avatarUrl=getPersonAvatarUrl(baseDir,postJsonObject['actor'],personCache)