Alter left column html generation

alt-html-css
Admin 2020-11-27 17:46:15 +00:00
parent f97c0a43a5
commit 81743813f7
1 changed files with 20 additions and 8 deletions

View File

@ -96,7 +96,9 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
if editImageClass == 'leftColEdit':
htmlStr += '\n <center>\n'
htmlStr += ' <div class="leftColIcons">\n'
if editor or rssIconAtTop:
htmlStr += ' <div class="leftColIcons">\n'
if editor:
# show the edit icon
htmlStr += \
@ -128,7 +130,9 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
'" src="/icons/logorss.png" /></a>\n'
if rssIconAtTop:
htmlStr += rssIconStr
htmlStr += ' </div>\n'
if editor or rssIconAtTop:
htmlStr += ' </div>\n'
if editImageClass == 'leftColEdit':
htmlStr += ' </center>\n'
@ -160,7 +164,9 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
linksList = sharesList + linksList
if linksList:
htmlStr += '<nav>\n'
# Bool to enable clean <div> creation for sub-lists
firstList = True
for lineStr in linksList:
if ' ' not in lineStr:
if '#' not in lineStr:
@ -187,17 +193,21 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
lineStr = lineStr[:len(lineStr)-1]
# add link to the returned html
htmlStr += \
' <p><a href="' + linkStr + \
'" target="_blank" ' + \
'rel="nofollow noopener noreferrer">' + \
lineStr + '</a></p>\n'
' <a href="' + linkStr + '">' + \
lineStr + '</a>\n'
linksFileContainsEntries = True
else:
if lineStr.startswith('#') or lineStr.startswith('*'):
if not firstList:
htmlStr += \
' </div>'
firstList = False
lineStr = lineStr[1:].strip()
if firstSeparatorAdded:
htmlStr += separatorStr
firstSeparatorAdded = True
htmlStr += \
' <div class="links-list">'
htmlStr += \
' <h3 class="linksHeader">' + \
lineStr + '</h3>\n'
@ -205,7 +215,9 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
htmlStr += \
' <p>' + lineStr + '</p>\n'
linksFileContainsEntries = True
htmlStr += '</nav>\n'
# Close of last links-list
htmlStr += \
' </div>'
if firstSeparatorAdded:
htmlStr += separatorStr