mirror of https://gitlab.com/bashrc2/epicyon
Substitute broken avatars on person options screen
parent
e996141fd8
commit
98fdf7d1f2
|
@ -18,6 +18,7 @@ from follow import isFollowingActor
|
|||
from followingCalendar import receivingCalendarEvents
|
||||
from webapp_utils import htmlHeaderWithExternalStyle
|
||||
from webapp_utils import htmlFooter
|
||||
from webapp_utils import getBrokenLinkSubstitute
|
||||
|
||||
|
||||
def htmlPersonOptions(defaultTimeline: str,
|
||||
|
@ -103,7 +104,7 @@ def htmlPersonOptions(defaultTimeline: str,
|
|||
optionsStr += ' <center>\n'
|
||||
optionsStr += ' <a href="' + optionsActor + '">\n'
|
||||
optionsStr += ' <img loading="lazy" src="' + optionsProfileUrl + \
|
||||
'"/></a>\n'
|
||||
'" ' + getBrokenLinkSubstitute() + '/></a>\n'
|
||||
handle = getNicknameFromActor(optionsActor) + '@' + optionsDomain
|
||||
optionsStr += \
|
||||
' <p class="optionsText">' + translate['Options for'] + \
|
||||
|
|
|
@ -55,6 +55,7 @@ from webapp_utils import getContentWarningButton
|
|||
from webapp_utils import getPostAttachmentsAsHtml
|
||||
from webapp_utils import htmlHeaderWithExternalStyle
|
||||
from webapp_utils import htmlFooter
|
||||
from webapp_utils import getBrokenLinkSubstitute
|
||||
from webapp_media import addEmbeddedElements
|
||||
from webapp_question import insertQuestion
|
||||
from devices import E2EEdecryptMessageFromDevice
|
||||
|
@ -201,14 +202,6 @@ def getAvatarImageUrl(session,
|
|||
return avatarUrl
|
||||
|
||||
|
||||
def getBrokenLinkSubstitute() -> str:
|
||||
"""Returns html used to show a default image if the link to
|
||||
an image is broken
|
||||
"""
|
||||
return " onerror=\"this.onerror=null; this.src='" + \
|
||||
"/icons/avatar_default.png'\""
|
||||
|
||||
|
||||
def getAvatarImageHtml(showAvatarOptions: bool,
|
||||
nickname: str, domainFull: str,
|
||||
avatarUrl: str, postActor: str,
|
||||
|
|
|
@ -20,6 +20,14 @@ from content import addHtmlTags
|
|||
from content import replaceEmojiFromTags
|
||||
|
||||
|
||||
def getBrokenLinkSubstitute() -> str:
|
||||
"""Returns html used to show a default image if the link to
|
||||
an image is broken
|
||||
"""
|
||||
return " onerror=\"this.onerror=null; this.src='" + \
|
||||
"/icons/avatar_default.png'\""
|
||||
|
||||
|
||||
def htmlFollowingList(cssCache: {}, baseDir: str,
|
||||
followingFilename: str) -> str:
|
||||
"""Returns a list of handles being followed
|
||||
|
|
Loading…
Reference in New Issue