Make youtube replacement domain configurable

merge-requests/8/head
Bob Mottram 2020-08-02 11:39:08 +01:00
parent bf8bf6834c
commit 407c6509bd
2 changed files with 20 additions and 0 deletions

View File

@ -6307,6 +6307,16 @@ class PubServer(BaseHTTPRequestHandler):
setConfigParam(self.server.baseDir,
'instanceTitle',
fields['instanceTitle'])
if fields.get('ytdomain'):
currYTDomain = self.server.YTReplacementDomain
if fields['ytdomain'] != currYTDomain:
setConfigParam(self.server.baseDir,
'youtubedomain',
fields['ytdomain'])
self.server.YTReplacementDomain = \
fields['ytdomain']
currInstanceDescriptionShort = \
getConfigParam(self.server.baseDir,
'instanceDescriptionShort')

View File

@ -1505,6 +1505,16 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
' <textarea id="message" name="gitProjects" ' + \
'style="height:100px">' + gitProjectsStr + '</textarea>'
editProfileForm += \
' <br><b><label class="labels">' + \
translate['YouTube Replacement Domain'] + '</label></b>'
YTReplacementDomain = getConfigParam(baseDir, "youtubedomain")
if not YTReplacementDomain:
YTReplacementDomain = ''
editProfileForm += \
' <input type="text" name="ytdomain" value="' + \
YTReplacementDomain + '">'
editProfileForm += ' </div>'
editProfileForm += ' <div class="container">'
editProfileForm += \