Simplify left/right column html

alt-html-css
Admin 2020-11-24 14:08:55 +00:00
parent 13b57ff16a
commit 3c86807116
2 changed files with 14 additions and 37 deletions

View File

@ -79,20 +79,9 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
domain = domain.split(':') domain = domain.split(':')
editImageClass = '' editImageClass = ''
if showHeaderImage:
leftImageFile, leftColumnImageFilename = \
getLeftImageFile(baseDir, nickname, domain, theme)
# show the image at the top of the column # show a column header, eg. title of the theme or newswire banner
editImageClass = 'leftColEdit' htmlStr += '<h1>Links</h1>\n'
if os.path.isfile(leftColumnImageFilename):
editImageClass = 'leftColEditImage'
htmlStr += \
'\n <center>\n' + \
' <img class="leftColImg" ' + \
'loading="lazy" src="/users/' + \
nickname + '/' + leftImageFile + '" />\n' + \
' </center>\n'
if showBackButton: if showBackButton:
htmlStr += \ htmlStr += \
@ -221,11 +210,14 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
if firstSeparatorAdded: if firstSeparatorAdded:
htmlStr += separatorStr htmlStr += separatorStr
htmlStr += \ htmlStr += \
'<p class="login-text"><a href="/about">' + \ '<div class="login-text">\n' + \
translate['About this Instance'] + '</a></p>' '<a href="/about">' + \
htmlStr += \ translate['About this Instance'] + \
'<p class="login-text"><a href="/terms">' + \ '</a>\n' + \
translate['Terms of Service'] + '</a></p>' '<a href="/terms">' + \
translate['Terms of Service'] + \
'</a>\n' + \
'</div>\n'
if linksFileContainsEntries and not rssIconAtTop: if linksFileContainsEntries and not rssIconAtTop:
htmlStr += '<br><div class="columnIcons">' + rssIconStr + '</div>' htmlStr += '<br><div class="columnIcons">' + rssIconStr + '</div>'

View File

@ -78,24 +78,12 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
if publishButtonAtTop: if publishButtonAtTop:
htmlStr += '<center>' + publishButtonStr + '</center>' htmlStr += '<center>' + publishButtonStr + '</center>'
# show a column header image, eg. title of the theme or newswire banner
editImageClass = '' editImageClass = ''
if showHeaderImage:
rightImageFile, rightColumnImageFilename = \
getRightImageFile(baseDir, nickname, domain, theme)
# show the image at the top of the column # show a column header, eg. title of the theme or newswire banner
editImageClass = 'rightColEdit' htmlStr += '<h1>Newswire</h1>\n'
if os.path.isfile(rightColumnImageFilename):
editImageClass = 'rightColEditImage'
htmlStr += \
'\n <center>\n' + \
' <img class="rightColImg" ' + \
'loading="lazy" src="/users/' + \
nickname + '/' + rightImageFile + '" />\n' + \
' </center>\n'
if (showPublishButton or editor or rssIconAtTop) and not showHeaderImage: if (showPublishButton or editor or rssIconAtTop):
htmlStr += '<div class="columnIcons">' htmlStr += '<div class="columnIcons">'
if editImageClass == 'rightColEdit': if editImageClass == 'rightColEdit':
@ -168,11 +156,8 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
if editImageClass == 'rightColEdit': if editImageClass == 'rightColEdit':
htmlStr += ' </center>\n' htmlStr += ' </center>\n'
else:
if showHeaderImage:
htmlStr += ' <br>\n'
if (showPublishButton or editor or rssIconAtTop) and not showHeaderImage: if (showPublishButton or editor or rssIconAtTop):
htmlStr += '</div><br>' htmlStr += '</div><br>'
# show the newswire lines # show the newswire lines