Missing parameters

merge-requests/30/head
Bob Mottram 2020-12-20 18:16:53 +00:00
parent 82636e7c2b
commit 49d99488df
7 changed files with 31 additions and 24 deletions

View File

@ -1949,7 +1949,8 @@ class PubServer(BaseHTTPRequestHandler):
domain,
domainFull,
self.server.defaultTimeline,
self.server.newswire).encode('utf-8')
self.server.newswire,
self.server.themeName).encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
self._write(msg)
@ -2042,7 +2043,8 @@ class PubServer(BaseHTTPRequestHandler):
domain,
domainFull,
self.server.defaultTimeline,
self.server.newswire).encode('utf-8')
self.server.newswire,
self.server.themeName).encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
self._write(msg)
@ -9217,7 +9219,8 @@ class PubServer(BaseHTTPRequestHandler):
nickname, domain,
domainFull,
self.server.defaultTimeline,
self.server.newswire).encode('utf-8')
self.server.newswire,
self.server.themeName).encode('utf-8')
if not msg:
print('Error replying to ' + inReplyToUrl)
self._404()
@ -9246,7 +9249,8 @@ class PubServer(BaseHTTPRequestHandler):
path, domain,
port,
httpPrefix,
self.server.defaultTimeline).encode('utf-8')
self.server.defaultTimeline,
self.server.themeName).encode('utf-8')
if msg:
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -9295,7 +9299,8 @@ class PubServer(BaseHTTPRequestHandler):
path, domain,
port,
httpPrefix,
self.server.defaultTimeline).encode('utf-8')
self.server.defaultTimeline,
self.server.themeName).encode('utf-8')
if msg:
self._set_headers('text/html', len(msg),
cookie, callingDomain)
@ -11728,7 +11733,8 @@ class PubServer(BaseHTTPRequestHandler):
fields['subject'],
fields['message'],
filename, attachmentMediaType,
fields['imageDescription'])
fields['imageDescription'],
self.server.themeName)
if messageJson:
messageJson = messageJson.encode('utf-8')
self._set_headers('text/html',

View File

@ -8,18 +8,15 @@ __status__ = "Production"
import os
from datetime import datetime
from shutil import copyfile
from content import removeLongWords
from utils import removeHtml
from utils import locatePost
from utils import loadJson
from utils import getConfigParam
from utils import votesOnNewswireItem
from utils import getNicknameFromActor
from utils import isEditor
from posts import isModerator
from webapp_utils import getRightImageFile
from webapp_utils import getImageFile
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
from webapp_utils import getBannerFile
@ -282,7 +279,8 @@ def htmlCitations(baseDir: str, nickname: str, domain: str,
blogTitle: str, blogContent: str,
blogImageFilename: str,
blogImageAttachmentMediaType: str,
blogImageDescription: str) -> str:
blogImageDescription: str,
theme: str) -> str:
"""Show the citations screen when creating a blog
"""
htmlStr = ''
@ -314,7 +312,8 @@ def htmlCitations(baseDir: str, nickname: str, domain: str,
htmlStr = htmlHeaderWithExternalStyle(cssFilename)
# top banner
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain, theme)
htmlStr += \
'<a href="/users/' + nickname + '/newblog" title="' + \
translate['Go Back'] + '" alt="' + \
@ -422,7 +421,8 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str,
htmlStr = htmlHeaderWithExternalStyle(cssFilename)
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain, theme)
htmlStr += \
'<a href="/users/' + nickname + '/' + defaultTimeline + '">' + \
'<img loading="lazy" class="timeline-banner" ' + \
@ -458,7 +458,7 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str,
def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
domain: str, port: int, httpPrefix: str,
defaultTimeline: str) -> str:
defaultTimeline: str, theme: str) -> str:
"""Shows the edit newswire screen
"""
if '/users/' not in path:
@ -479,7 +479,8 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
cssFilename = baseDir + '/links.css'
# filename of the banner shown at the top
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain, theme)
editNewswireForm = htmlHeaderWithExternalStyle(cssFilename)

View File

@ -169,7 +169,8 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
reportUrl: str, pageNumber: int,
nickname: str, domain: str,
domainFull: str,
defaultTimeline: str, newswire: {}) -> str:
defaultTimeline: str, newswire: {},
theme: str) -> str:
"""New post screen
"""
replyStr = ''
@ -178,7 +179,8 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
messageBoxHeight = 400
# filename of the banner shown at the top
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain, theme)
if not path.endswith('/newshare'):
if not path.endswith('/newreport'):

View File

@ -104,7 +104,8 @@ def htmlFrontScreen(rssIconAtTop: bool,
iconsAsButtons)
# If this is the news account then show a different banner
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain, theme)
profileHeaderStr = \
'<img loading="lazy" class="timeline-banner" ' + \
'src="/users/' + nickname + '/' + bannerFile + '" />\n'
@ -136,7 +137,7 @@ def htmlFrontScreen(rssIconAtTop: bool,
licenseStr = ''
bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain)
getBannerFile(baseDir, nickname, domain, theme)
profileStr += \
htmlFrontScreenPosts(recentPostsCache, maxRecentPosts,
translate,

View File

@ -9,12 +9,10 @@ __status__ = "Production"
import os
from shutil import copyfile
from datetime import datetime
from utils import getConfigParam
from utils import getNicknameFromActor
from utils import getHashtagCategories
from utils import getHashtagCategory
from webapp_utils import getSearchBannerFile
from webapp_utils import getImageFile
from webapp_utils import getContentWarningButton
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter

View File

@ -830,7 +830,7 @@ def htmlProfileShares(actor: str, translate: {},
def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
domain: str, port: int, httpPrefix: str,
defaultTimeline: str) -> str:
defaultTimeline: str, theme: str) -> str:
"""Shows the edit profile screen
"""
imageFormats = getImageFormats()
@ -847,7 +847,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
return ''
# filename of the banner shown at the top
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain, theme)
isBot = ''
isGroup = ''

View File

@ -15,7 +15,6 @@ from utils import isEditor
from utils import loadJson
from utils import getDomainFromActor
from utils import getNicknameFromActor
from utils import getConfigParam
from utils import locatePost
from utils import isPublicPost
from utils import firstParagraphFromString
@ -24,7 +23,6 @@ from utils import getHashtagCategory
from feeds import rss2TagHeader
from feeds import rss2TagFooter
from webapp_utils import getAltPath
from webapp_utils import getImageFile
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
from webapp_utils import getSearchBannerFile