From 114f2039dda885b2310df764e7b24e8a49118214 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 31 Oct 2020 12:34:13 +0000 Subject: [PATCH] Rss icon at bottom of links screen on mobile --- daemon.py | 25 +++++++++++++++++-------- webinterface.py | 21 +++++++++++++-------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/daemon.py b/daemon.py index 1eedc9b7c..294d0a63c 100644 --- a/daemon.py +++ b/daemon.py @@ -6066,7 +6066,8 @@ class PubServer(BaseHTTPRequestHandler): iconsAsButtons = \ self.server.iconsAsButtons msg = \ - htmlProfile(self.server.cssCache, + htmlProfile(self.server.rssIconAtTop, + self.server.cssCache, iconsAsButtons, defaultTimeline, recentPostsCache, @@ -6144,7 +6145,8 @@ class PubServer(BaseHTTPRequestHandler): iconsAsButtons = \ self.server.iconsAsButtons msg = \ - htmlProfile(self.server.cssCache, + htmlProfile(self.server.rssIconAtTop, + self.server.cssCache, iconsAsButtons, defaultTimeline, recentPostsCache, @@ -7708,7 +7710,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.GETbusy = False return True msg = \ - htmlProfile(self.server.cssCache, + htmlProfile(self.server.rssIconAtTop, + self.server.cssCache, self.server.iconsAsButtons, self.server.defaultTimeline, self.server.recentPostsCache, @@ -7798,7 +7801,8 @@ class PubServer(BaseHTTPRequestHandler): return True msg = \ - htmlProfile(self.server.cssCache, + htmlProfile(self.server.rssIconAtTop, + self.server.cssCache, self.server.iconsAsButtons, self.server.defaultTimeline, self.server.recentPostsCache, @@ -7887,7 +7891,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.GETbusy = False return True msg = \ - htmlProfile(self.server.cssCache, + htmlProfile(self.server.rssIconAtTop, + self.server.cssCache, self.server.iconsAsButtons, self.server.defaultTimeline, self.server.recentPostsCache, @@ -7952,7 +7957,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.GETbusy = False return True msg = \ - htmlProfile(self.server.cssCache, + htmlProfile(self.server.rssIconAtTop, + self.server.cssCache, self.server.iconsAsButtons, self.server.defaultTimeline, self.server.recentPostsCache, @@ -9512,6 +9518,7 @@ class PubServer(BaseHTTPRequestHandler): timelinePath = \ '/users/' + nickname + '/' + self.server.defaultTimeline showPublishAsIcon = self.server.showPublishAsIcon + rssIconAtTop = self.server.rssIconAtTop msg = htmlNewswireMobile(self.server.cssCache, self.server.baseDir, nickname, @@ -9523,7 +9530,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.positiveVoting, timelinePath, showPublishAsIcon, - authorized).encode('utf-8') + authorized, + rssIconAtTop).encode('utf-8') self._set_headers('text/html', len(msg), cookie, callingDomain) self._write(msg) @@ -9549,7 +9557,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.httpPrefix, self.server.translate, timelinePath, - authorized).encode('utf-8') + authorized, + self.server.rssIconAtTop).encode('utf-8') self._set_headers('text/html', len(msg), cookie, callingDomain) self._write(msg) self.server.GETbusy = False diff --git a/webinterface.py b/webinterface.py index afe1a976a..794b8ad2c 100644 --- a/webinterface.py +++ b/webinterface.py @@ -3298,7 +3298,8 @@ def htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int, return timelineStr -def htmlProfile(cssCache: {}, iconsAsButtons: bool, +def htmlProfile(rssIconAtTop: bool, + cssCache: {}, iconsAsButtons: bool, defaultTimeline: str, recentPostsCache: {}, maxRecentPosts: int, translate: {}, projectVersion: str, @@ -3518,7 +3519,7 @@ def htmlProfile(cssCache: {}, iconsAsButtons: bool, getLeftColumnContent(baseDir, 'news', domainFull, httpPrefix, translate, iconsDir, False, - False, None, False, True) + False, None, rssIconAtTop, True) profileHeaderStr += ' \n' profileHeaderStr += ' \n' else: @@ -5607,7 +5608,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str, translate['RSS feed for this site'] + \ '" title="' + translate['RSS feed for this site'] + \ '" src="/' + iconsDir + '/logorss.png" />\n' - if rssIconAtTop: + if rssIconAtTop and showHeaderImage: htmlStr += rssIconStr if editImageClass == 'leftColEdit': @@ -5662,7 +5663,8 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str, '

' + lineStr + '

\n' linksFileContainsEntries = True - if linksFileContainsEntries and not rssIconAtTop: + rssAtBottom = not rssIconAtTop or not showHeaderImage + if linksFileContainsEntries and rssAtBottom: htmlStr += '
' + rssIconStr return htmlStr @@ -5887,7 +5889,8 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str, def htmlLinksMobile(cssCache: {}, baseDir: str, nickname: str, domainFull: str, httpPrefix: str, translate, - timelinePath: str, authorized: bool) -> str: + timelinePath: str, authorized: bool, + rssIconAtTop: bool) -> str: """Show the left column links within mobile view """ htmlStr = '' @@ -5923,7 +5926,8 @@ def htmlLinksMobile(cssCache: {}, baseDir: str, getLeftColumnContent(baseDir, nickname, domainFull, httpPrefix, translate, iconsDir, editor, - False, timelinePath, True, False) + False, timelinePath, + rssIconAtTop, False) htmlStr += '\n' + htmlFooter() return htmlStr @@ -5935,7 +5939,8 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str, positiveVoting: bool, timelinePath: str, showPublishAsIcon: bool, - authorized: bool) -> str: + authorized: bool, + rssIconAtTop: bool) -> str: """Shows the mobile version of the newswire right column """ htmlStr = '' @@ -5980,7 +5985,7 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str, iconsDir, moderator, editor, newswire, positiveVoting, False, timelinePath, showPublishButton, - showPublishAsIcon, True, False, + showPublishAsIcon, rssIconAtTop, False, authorized, False) htmlStr += htmlFooter() return htmlStr