diff --git a/daemon.py b/daemon.py index 4a51bd287..1a1cd2814 100644 --- a/daemon.py +++ b/daemon.py @@ -2222,9 +2222,9 @@ class PubServer(BaseHTTPRequestHandler): # set boolean values if 'rss-icon-at-top' in themeDesignerParams: if themeDesignerParams['rss-icon-at-top'].lower() == 'true': - self.server.rssIconAtTop = True + self.server.rss_icon_at_top = True else: - self.server.rssIconAtTop = False + self.server.rss_icon_at_top = False if 'publish-button-at-top' in themeDesignerParams: if themeDesignerParams['publish-button-at-top'].lower() == 'true': self.server.publish_button_at_top = True @@ -5024,9 +5024,9 @@ class PubServer(BaseHTTPRequestHandler): self.server.iconsAsButtons = \ getConfigParam(self.server.base_dir, 'iconsAsButtons') - self.server.rssIconAtTop = \ + self.server.rss_icon_at_top = \ getConfigParam(self.server.base_dir, - 'rssIconAtTop') + 'rss_icon_at_top') self.server.publish_button_at_top = \ getConfigParam(self.server.base_dir, 'publish_button_at_top') @@ -5965,9 +5965,9 @@ class PubServer(BaseHTTPRequestHandler): self.server.iconsAsButtons = \ getConfigParam(base_dir, 'iconsAsButtons') - self.server.rssIconAtTop = \ + self.server.rss_icon_at_top = \ getConfigParam(base_dir, - 'rssIconAtTop') + 'rss_icon_at_top') self.server.publish_button_at_top = \ getConfigParam(base_dir, 'publish_button_at_top') @@ -9688,7 +9688,7 @@ class PubServer(BaseHTTPRequestHandler): base_dir, nickname, domain) msg = \ htmlProfile(self.server.signingPrivateKeyPem, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.cssCache, iconsAsButtons, defaultTimeline, @@ -9804,7 +9804,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.content_license_url msg = \ htmlProfile(signingPrivateKeyPem, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.cssCache, iconsAsButtons, defaultTimeline, @@ -10250,7 +10250,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.showPublishAsIcon, fullWidthTimelineButtonHeader, self.server.iconsAsButtons, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.publish_button_at_top, authorized, self.server.themeName, @@ -10401,7 +10401,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.showPublishAsIcon, fullWidthTimelineButtonHeader, self.server.iconsAsButtons, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, @@ -10544,7 +10544,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.showPublishAsIcon, fullWidthTimelineButtonHeader, self.server.iconsAsButtons, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, @@ -10685,7 +10685,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.showPublishAsIcon, fullWidthTimelineButtonHeader, self.server.iconsAsButtons, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.publish_button_at_top, authorized, self.server.themeName, @@ -10827,7 +10827,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.showPublishAsIcon, fullWidthTimelineButtonHeader, self.server.iconsAsButtons, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.publish_button_at_top, authorized, self.server.themeName, @@ -10979,7 +10979,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.showPublishAsIcon, fullWidthTimelineButtonHeader, self.server.iconsAsButtons, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.publish_button_at_top, authorized, self.server.themeName, @@ -11128,7 +11128,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.showPublishAsIcon, fullWidthTimelineButtonHeader, self.server.iconsAsButtons, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.publish_button_at_top, authorized, self.server.themeName, @@ -11235,7 +11235,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.showPublishAsIcon, self.server.fullWidthTimelineButtonHeader, self.server.iconsAsButtons, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, @@ -11319,7 +11319,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.showPublishAsIcon, self.server.fullWidthTimelineButtonHeader, self.server.iconsAsButtons, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.publish_button_at_top, authorized, self.server.themeName, self.server.peertubeInstances, @@ -11441,7 +11441,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.showPublishAsIcon, fullWidthTimelineButtonHeader, self.server.iconsAsButtons, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.publish_button_at_top, authorized, self.server.themeName, @@ -11579,7 +11579,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.showPublishAsIcon, fullWidthTimelineButtonHeader, self.server.iconsAsButtons, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.publish_button_at_top, authorized, self.server.themeName, @@ -11711,7 +11711,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.showPublishAsIcon, fullWidthTimelineButtonHeader, self.server.iconsAsButtons, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.publish_button_at_top, authorized, moderationActionStr, self.server.themeName, @@ -11815,7 +11815,7 @@ class PubServer(BaseHTTPRequestHandler): base_dir, nickname, domain) msg = \ htmlProfile(self.server.signingPrivateKeyPem, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.cssCache, self.server.iconsAsButtons, self.server.defaultTimeline, @@ -11936,7 +11936,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.content_license_url msg = \ htmlProfile(self.server.signingPrivateKeyPem, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.cssCache, self.server.iconsAsButtons, self.server.defaultTimeline, @@ -12055,7 +12055,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.content_license_url msg = \ htmlProfile(self.server.signingPrivateKeyPem, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.cssCache, self.server.iconsAsButtons, self.server.defaultTimeline, @@ -12191,7 +12191,7 @@ class PubServer(BaseHTTPRequestHandler): base_dir, nickname, domain) msg = \ htmlProfile(self.server.signingPrivateKeyPem, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, self.server.cssCache, self.server.iconsAsButtons, self.server.defaultTimeline, @@ -14958,7 +14958,7 @@ class PubServer(BaseHTTPRequestHandler): timelinePath = \ '/users/' + nickname + '/' + self.server.defaultTimeline showPublishAsIcon = self.server.showPublishAsIcon - rssIconAtTop = self.server.rssIconAtTop + rss_icon_at_top = self.server.rss_icon_at_top iconsAsButtons = self.server.iconsAsButtons defaultTimeline = self.server.defaultTimeline accessKeys = self.server.accessKeys @@ -14976,7 +14976,7 @@ class PubServer(BaseHTTPRequestHandler): timelinePath, showPublishAsIcon, authorized, - rssIconAtTop, + rss_icon_at_top, iconsAsButtons, defaultTimeline, self.server.themeName, @@ -15015,7 +15015,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.translate, timelinePath, authorized, - self.server.rssIconAtTop, + self.server.rss_icon_at_top, iconsAsButtons, defaultTimeline, self.server.themeName, @@ -18430,7 +18430,7 @@ def runDaemon(content_license_url: str, allow_local_network_access: bool, max_feed_item_size_kb: int, publish_button_at_top: bool, - rssIconAtTop: bool, + rss_icon_at_top: bool, iconsAsButtons: bool, fullWidthTimelineButtonHeader: bool, showPublishAsIcon: bool, @@ -18668,7 +18668,7 @@ def runDaemon(content_license_url: str, httpd.iconsAsButtons = iconsAsButtons # whether to show the RSS icon at the top or the bottom of the timeline - httpd.rssIconAtTop = rssIconAtTop + httpd.rss_icon_at_top = rss_icon_at_top # Whether to show the newswire publish button at the top, # above the header image diff --git a/epicyon.py b/epicyon.py index 6b83a9e21..0c2daeeda 100644 --- a/epicyon.py +++ b/epicyon.py @@ -347,8 +347,8 @@ parser.add_argument("--log_login_failures", type=str2bool, nargs='?', const=True, default=False, help="Whether to log longin failures") -parser.add_argument("--rssIconAtTop", - dest='rssIconAtTop', +parser.add_argument("--rss_icon_at_top", + dest='rss_icon_at_top', type=str2bool, nargs='?', const=True, default=True, help="Whether to show the rss icon at teh top or bottom" + @@ -3088,10 +3088,10 @@ iconsAsButtons = \ if iconsAsButtons is not None: args.iconsAsButtons = bool(iconsAsButtons) -rssIconAtTop = \ - getConfigParam(base_dir, 'rssIconAtTop') -if rssIconAtTop is not None: - args.rssIconAtTop = bool(rssIconAtTop) +rss_icon_at_top = \ + getConfigParam(base_dir, 'rss_icon_at_top') +if rss_icon_at_top is not None: + args.rss_icon_at_top = bool(rss_icon_at_top) publish_button_at_top = \ getConfigParam(base_dir, 'publish_button_at_top') @@ -3228,7 +3228,7 @@ if __name__ == "__main__": args.allow_local_network_access, args.max_feed_item_size_kb, args.publish_button_at_top, - args.rssIconAtTop, + args.rss_icon_at_top, args.iconsAsButtons, args.fullWidthTimelineButtonHeader, args.showPublishAsIcon, diff --git a/theme.py b/theme.py index ca0bb7464..b29aedbd2 100644 --- a/theme.py +++ b/theme.py @@ -210,7 +210,7 @@ def _setRssIconAtTop(base_dir: str, atTop: bool) -> bool: configJson = loadJson(configFilename, 0) if not configJson: return False - configJson['rssIconAtTop'] = atTop + configJson['rss_icon_at_top'] = atTop return saveJson(configJson, configFilename) diff --git a/webapp_column_left.py b/webapp_column_left.py index 23462f4d2..c52147470 100644 --- a/webapp_column_left.py +++ b/webapp_column_left.py @@ -116,7 +116,7 @@ def getLeftColumnContent(base_dir: str, nickname: str, domainFull: str, http_prefix: str, translate: {}, editor: bool, artist: bool, showBackButton: bool, timelinePath: str, - rssIconAtTop: bool, showHeaderImage: bool, + rss_icon_at_top: bool, showHeaderImage: bool, frontPage: bool, theme: str, accessKeys: {}, shared_items_federated_domains: []) -> str: @@ -148,7 +148,7 @@ def getLeftColumnContent(base_dir: str, nickname: str, domainFull: str, '\n' - if (editor or rssIconAtTop) and not showHeaderImage: + if (editor or rss_icon_at_top) and not showHeaderImage: htmlStr += '
' if editImageClass == 'leftColEdit': @@ -190,14 +190,14 @@ def getLeftColumnContent(base_dir: str, nickname: str, domainFull: str, ' ' + rssTitle + '\n' - if rssIconAtTop: + if rss_icon_at_top: htmlStr += rssIconStr htmlStr += '
\n' if editImageClass == 'leftColEdit': htmlStr += ' \n' - if (editor or rssIconAtTop) and not showHeaderImage: + if (editor or rss_icon_at_top) and not showHeaderImage: htmlStr += '
' # if showHeaderImage: @@ -342,7 +342,7 @@ def getLeftColumnContent(base_dir: str, nickname: str, domainFull: str, '

' + \ translate['Terms of Service'] + '

' - if linksFileContainsEntries and not rssIconAtTop: + if linksFileContainsEntries and not rss_icon_at_top: htmlStr += '
' + rssIconStr + '
' return htmlStr @@ -352,7 +352,7 @@ def htmlLinksMobile(cssCache: {}, base_dir: str, nickname: str, domainFull: str, http_prefix: str, translate, timelinePath: str, authorized: bool, - rssIconAtTop: bool, + rss_icon_at_top: bool, iconsAsButtons: bool, defaultTimeline: str, theme: str, accessKeys: {}, @@ -398,7 +398,7 @@ def htmlLinksMobile(cssCache: {}, base_dir: str, http_prefix, translate, editor, artist, False, timelinePath, - rssIconAtTop, False, False, + rss_icon_at_top, False, False, theme, accessKeys, shared_items_federated_domains) if editor and not _linksExist(base_dir): diff --git a/webapp_column_right.py b/webapp_column_right.py index 4963157f3..04ae905d2 100644 --- a/webapp_column_right.py +++ b/webapp_column_right.py @@ -54,7 +54,7 @@ def getRightColumnContent(base_dir: str, nickname: str, domainFull: str, showBackButton: bool, timelinePath: str, showPublishButton: bool, showPublishAsIcon: bool, - rssIconAtTop: bool, + rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, showHeaderImage: bool, @@ -108,8 +108,9 @@ def getRightColumnContent(base_dir: str, nickname: str, domainFull: str, nickname + '/' + rightImageFile + '" />\n' + \ ' \n' - if (showPublishButton or editor or rssIconAtTop) and not showHeaderImage: - htmlStr += '
' + if showPublishButton or editor or rss_icon_at_top: + if not showHeaderImage: + htmlStr += '
' if editImageClass == 'rightColEdit': htmlStr += '\n
\n' @@ -166,7 +167,7 @@ def getRightColumnContent(base_dir: str, nickname: str, domainFull: str, translate['Newswire RSS Feed'] + ' | " title="' + \ translate['Newswire RSS Feed'] + '" src="/' + \ 'icons/logorss.png" />\n' - if rssIconAtTop: + if rss_icon_at_top: htmlStr += rssIconStr # show publish icon at top @@ -191,8 +192,9 @@ def getRightColumnContent(base_dir: str, nickname: str, domainFull: str, if showHeaderImage: htmlStr += '
\n' - if (showPublishButton or editor or rssIconAtTop) and not showHeaderImage: - htmlStr += '

' + if showPublishButton or editor or rss_icon_at_top: + if not showHeaderImage: + htmlStr += '

' # show the newswire lines newswireContentStr = \ @@ -201,7 +203,7 @@ def getRightColumnContent(base_dir: str, nickname: str, domainFull: str, htmlStr += newswireContentStr # show the rss icon at the bottom, typically on the right hand side - if newswireContentStr and not rssIconAtTop: + if newswireContentStr and not rss_icon_at_top: htmlStr += '
' + rssIconStr + '
' return htmlStr @@ -450,7 +452,7 @@ def htmlNewswireMobile(cssCache: {}, base_dir: str, nickname: str, timelinePath: str, showPublishAsIcon: bool, authorized: bool, - rssIconAtTop: bool, + rss_icon_at_top: bool, iconsAsButtons: bool, defaultTimeline: str, theme: str, @@ -501,7 +503,7 @@ def htmlNewswireMobile(cssCache: {}, base_dir: str, nickname: str, moderator, editor, newswire, positiveVoting, False, timelinePath, showPublishButton, - showPublishAsIcon, rssIconAtTop, False, + showPublishAsIcon, rss_icon_at_top, False, authorized, False, theme, defaultTimeline, accessKeys) if editor and not newswire: diff --git a/webapp_frontscreen.py b/webapp_frontscreen.py index 10e1c662c..57cc3e16f 100644 --- a/webapp_frontscreen.py +++ b/webapp_frontscreen.py @@ -94,7 +94,7 @@ def _htmlFrontScreenPosts(recentPostsCache: {}, maxRecentPosts: int, def htmlFrontScreen(signingPrivateKeyPem: str, - rssIconAtTop: bool, + rss_icon_at_top: bool, cssCache: {}, iconsAsButtons: bool, defaultTimeline: str, recentPostsCache: {}, maxRecentPosts: int, @@ -156,7 +156,7 @@ def htmlFrontScreen(signingPrivateKeyPem: str, getLeftColumnContent(base_dir, 'news', domainFull, http_prefix, translate, False, False, - False, None, rssIconAtTop, True, + False, None, rss_icon_at_top, True, True, theme, accessKeys, shared_items_federated_domains) profileHeaderStr += \ diff --git a/webapp_moderation.py b/webapp_moderation.py index a4ea9c03e..04a7e266a 100644 --- a/webapp_moderation.py +++ b/webapp_moderation.py @@ -44,7 +44,7 @@ def htmlModeration(cssCache: {}, defaultTimeline: str, showPublishAsIcon: bool, fullWidthTimelineButtonHeader: bool, iconsAsButtons: bool, - rssIconAtTop: bool, + rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, moderationActionStr: str, theme: str, peertubeInstances: [], @@ -72,7 +72,7 @@ def htmlModeration(cssCache: {}, defaultTimeline: str, showPublishedDateOnly, newswire, False, False, artist, positiveVoting, showPublishAsIcon, fullWidthTimelineButtonHeader, - iconsAsButtons, rssIconAtTop, publish_button_at_top, + iconsAsButtons, rss_icon_at_top, publish_button_at_top, authorized, moderationActionStr, theme, peertubeInstances, allow_local_network_access, textModeBanner, accessKeys, systemLanguage, diff --git a/webapp_profile.py b/webapp_profile.py index af32a8818..47668f878 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -539,7 +539,7 @@ def _getProfileHeaderAfterSearch(base_dir: str, def htmlProfile(signingPrivateKeyPem: str, - rssIconAtTop: bool, + rss_icon_at_top: bool, cssCache: {}, iconsAsButtons: bool, defaultTimeline: str, recentPostsCache: {}, maxRecentPosts: int, @@ -568,7 +568,7 @@ def htmlProfile(signingPrivateKeyPem: str, return "" if isSystemAccount(nickname): return htmlFrontScreen(signingPrivateKeyPem, - rssIconAtTop, + rss_icon_at_top, cssCache, iconsAsButtons, defaultTimeline, recentPostsCache, maxRecentPosts, diff --git a/webapp_timeline.py b/webapp_timeline.py index 057a2b6a8..75e6993f7 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -361,7 +361,7 @@ def _htmlTimelineEnd(base_dir: str, nickname: str, domainFull: str, moderator: bool, editor: bool, newswire: {}, positiveVoting: bool, showPublishAsIcon: bool, - rssIconAtTop: bool, publish_button_at_top: bool, + rss_icon_at_top: bool, publish_button_at_top: bool, authorized: bool, theme: str, defaultTimeline: str, accessKeys: {}, boxName: str, @@ -381,7 +381,8 @@ def _htmlTimelineEnd(base_dir: str, nickname: str, domainFull: str, newswire, positiveVoting, False, None, True, showPublishAsIcon, - rssIconAtTop, publish_button_at_top, + rss_icon_at_top, + publish_button_at_top, authorized, True, theme, defaultTimeline, accessKeys) tlStr += '