mirror of https://gitlab.com/bashrc2/epicyon
Only apply media style to images
parent
0f65fb5084
commit
2018669365
|
@ -508,7 +508,7 @@ a:focus {
|
||||||
}
|
}
|
||||||
|
|
||||||
.media {
|
.media {
|
||||||
width: 100%;
|
width: 80%;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
|
|
|
@ -870,7 +870,8 @@ def getPostAttachmentsAsHtml(postJsonObject: {}, boxName: str, translate: {},
|
||||||
return attachmentStr, galleryStr
|
return attachmentStr, galleryStr
|
||||||
|
|
||||||
attachmentCtr = 0
|
attachmentCtr = 0
|
||||||
attachmentStr += '<div class="media">\n'
|
attachmentStr = ''
|
||||||
|
mediaStyleAdded = False
|
||||||
for attach in postJsonObject['object']['attachment']:
|
for attach in postJsonObject['object']['attachment']:
|
||||||
if not (attach.get('mediaType') and attach.get('url')):
|
if not (attach.get('mediaType') and attach.get('url')):
|
||||||
continue
|
continue
|
||||||
|
@ -881,6 +882,10 @@ def getPostAttachmentsAsHtml(postJsonObject: {}, boxName: str, translate: {},
|
||||||
imageDescription = attach['name'].replace('"', "'")
|
imageDescription = attach['name'].replace('"', "'")
|
||||||
if _isImageMimeType(mediaType):
|
if _isImageMimeType(mediaType):
|
||||||
if _isAttachedImage(attach['url']):
|
if _isAttachedImage(attach['url']):
|
||||||
|
if not attachmentStr:
|
||||||
|
attachmentStr += '<div class="media">\n'
|
||||||
|
mediaStyleAdded = True
|
||||||
|
|
||||||
if attachmentCtr > 0:
|
if attachmentCtr > 0:
|
||||||
attachmentStr += '<br>'
|
attachmentStr += '<br>'
|
||||||
if boxName == 'tlmedia':
|
if boxName == 'tlmedia':
|
||||||
|
@ -1038,7 +1043,8 @@ def getPostAttachmentsAsHtml(postJsonObject: {}, boxName: str, translate: {},
|
||||||
translate['Your browser does not support the audio tag.']
|
translate['Your browser does not support the audio tag.']
|
||||||
attachmentStr += '</audio>\n</center>\n'
|
attachmentStr += '</audio>\n</center>\n'
|
||||||
attachmentCtr += 1
|
attachmentCtr += 1
|
||||||
attachmentStr += '</div>'
|
if mediaStyleAdded:
|
||||||
|
attachmentStr += '</div>'
|
||||||
return attachmentStr, galleryStr
|
return attachmentStr, galleryStr
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue