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