diff --git a/webinterface.py b/webinterface.py index 8c26fe12..361fafd0 100644 --- a/webinterface.py +++ b/webinterface.py @@ -3298,6 +3298,50 @@ def htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int, return timelineStr +def headerButtonsFrontScreen(translate: {}, + nickname: str, boxName: str, + authorized: bool) -> str: + """Returns the header buttons for the front page of a news instance + """ + headerStr = '
\n' + if nickname == 'news': + buttonFeatures = 'buttonMobile' + buttonNewswire = 'buttonMobile' + buttonLinks = 'buttonMobile' + if boxName == 'features': + buttonFeatures = 'buttonselected' + elif boxName == 'newswire': + buttonNewswire = 'buttonselected' + elif boxName == 'links': + buttonLinks = 'buttonselected' + + headerStr += \ + ' ' + \ + '\n' + headerStr += \ + ' \n' + headerStr += \ + ' \n' + if not authorized: + headerStr += \ + ' \n' + headerStr += '
\n' + return headerStr + + def htmlProfile(cssCache: {}, iconsAsButtons: bool, defaultTimeline: str, recentPostsCache: {}, maxRecentPosts: int, @@ -3407,32 +3451,8 @@ def htmlProfile(cssCache: {}, iconsAsButtons: bool, iconsDir = getIconsDir(baseDir) if not authorized: - # the links button to show left column links - loginButton = '
\n' - if nickname == 'news': - loginButton += \ - ' ' + \ - '\n' - loginButton += \ - ' \n' - loginButton += \ - ' \n' - loginButton += \ - ' \n' - loginButton += '
\n' + loginButton = headerButtonsFrontScreen(translate, nickname, + 'features', authorized) else: editProfileStr = \ '' + \