Show empty string if avatar is not available

main2
Bob Mottram 2019-11-01 22:23:34 +00:00
parent efc7e6e01b
commit a505a844a3
1 changed files with 4 additions and 4 deletions

View File

@ -1387,7 +1387,7 @@ def individualFollowAsHtml(translate: {}, \
return \ return \
'<div class="container">\n' \ '<div class="container">\n' \
'<a href="'+followUrl+'">' \ '<a href="'+followUrl+'">' \
'<p><img loading="lazy" src="'+avatarUrl+'">\n'+ \ '<p><img loading="lazy" src="'+avatarUrl+'" alt="">\n'+ \
titleStr+'</a>'+buttonsStr+'</p>' \ titleStr+'</a>'+buttonsStr+'</p>' \
'</div>\n' '</div>\n'
@ -1839,7 +1839,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
'<a href="/users/'+nickname+'?options='+announceActor+';'+str(pageNumber)+';'+announceAvatarUrl+messageIdStr+'">' \ '<a href="/users/'+nickname+'?options='+announceActor+';'+str(pageNumber)+';'+announceAvatarUrl+messageIdStr+'">' \
'<img loading="lazy" src="'+announceAvatarUrl+'" ' \ '<img loading="lazy" src="'+announceAvatarUrl+'" ' \
'title="'+translate['Show options for this person']+ \ 'title="'+translate['Show options for this person']+ \
'" '+avatarPosition+'/></a></div>' '" alt=""'+avatarPosition+'/></a></div>'
else: else:
titleStr+=' <img loading="lazy" src="/'+iconsDir+'/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">@'+announceNickname+'@'+announceDomain+'</a>' titleStr+=' <img loading="lazy" src="/'+iconsDir+'/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">@'+announceNickname+'@'+announceDomain+'</a>'
else: else:
@ -1878,7 +1878,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
'<a href="/users/'+nickname+'?options='+replyActor+';'+str(pageNumber)+';'+replyAvatarUrl+messageIdStr+'">' \ '<a href="/users/'+nickname+'?options='+replyActor+';'+str(pageNumber)+';'+replyAvatarUrl+messageIdStr+'">' \
'<img loading="lazy" src="'+replyAvatarUrl+'" ' \ '<img loading="lazy" src="'+replyAvatarUrl+'" ' \
'title="'+translate['Show profile']+ \ 'title="'+translate['Show profile']+ \
'" '+avatarPosition+'/></a></div>' '" alt=""'+avatarPosition+'/></a></div>'
else: else:
titleStr+=' <img loading="lazy" src="/'+iconsDir+'/reply.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['inReplyTo']+'">@'+replyNickname+'@'+replyDomain+'</a>' titleStr+=' <img loading="lazy" src="/'+iconsDir+'/reply.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['inReplyTo']+'">@'+replyNickname+'@'+replyDomain+'</a>'
else: else:
@ -2002,7 +2002,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
avatarImageInPost= \ avatarImageInPost= \
' <div class="timeline-avatar">' \ ' <div class="timeline-avatar">' \
' <a href="'+postActor+'">' \ ' <a href="'+postActor+'">' \
' <img loading="lazy" src="'+avatarUrl+'" title="'+translate['Show profile']+'" '+avatarPosition+'/></a>' \ ' <img loading="lazy" src="'+avatarUrl+'" title="'+translate['Show profile']+'" alt=""'+avatarPosition+'/></a>' \
' </div>' ' </div>'
if showAvatarOptions and fullDomain+'/users/'+nickname not in postActor: if showAvatarOptions and fullDomain+'/users/'+nickname not in postActor: