diff --git a/epicyon.py b/epicyon.py index 0b890c1d5..35680c59e 100644 --- a/epicyon.py +++ b/epicyon.py @@ -1916,7 +1916,7 @@ if minimumvotes: votingtime = getConfigParam(baseDir, 'votingtime') if votingtime: args.votingtime = votingtime - + YTDomain = getConfigParam(baseDir, 'youtubedomain') if YTDomain: if '://' in YTDomain: diff --git a/webinterface.py b/webinterface.py index e5e55d31c..def0b0255 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1543,104 +1543,105 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str, moderatorsStr = '' themesDropdown = '' adminNickname = getConfigParam(baseDir, 'admin') - if path.startswith('/users/' + adminNickname + '/'): - instanceDescription = \ - getConfigParam(baseDir, 'instanceDescription') - instanceDescriptionShort = \ - getConfigParam(baseDir, 'instanceDescriptionShort') - instanceTitle = \ - getConfigParam(baseDir, 'instanceTitle') - instanceStr = '
' - instanceStr += \ - ' ' - if instanceTitle: + if adminNickname: + if path.startswith('/users/' + adminNickname + '/'): + instanceDescription = \ + getConfigParam(baseDir, 'instanceDescription') + instanceDescriptionShort = \ + getConfigParam(baseDir, 'instanceDescriptionShort') + instanceTitle = \ + getConfigParam(baseDir, 'instanceTitle') + instanceStr = '
' instanceStr += \ - '
' - else: + ' ' + if instanceTitle: + instanceStr += \ + '
' + else: + instanceStr += \ + '
' instanceStr += \ - '
' - instanceStr += \ - ' ' - if instanceDescriptionShort: + ' ' + if instanceDescriptionShort: + instanceStr += \ + '
' + else: + instanceStr += \ + '
' instanceStr += \ - '
' - else: + ' ' + if instanceDescription: + instanceStr += \ + ' ' + else: + instanceStr += \ + ' ' instanceStr += \ - '
' - instanceStr += \ - ' ' - if instanceDescription: + ' ' instanceStr += \ - ' ' - else: - instanceStr += \ - ' ' - instanceStr += \ - ' ' - instanceStr += \ - ' ' - instanceStr += '
' + ' ' + instanceStr += '
' - moderators = '' - moderatorsFile = baseDir + '/accounts/moderators.txt' - if os.path.isfile(moderatorsFile): - with open(moderatorsFile, "r") as f: - moderators = f.read() - moderatorsStr = '
' - moderatorsStr += ' ' + translate['Moderators'] + '
' - moderatorsStr += ' ' + \ - translate['A list of moderator nicknames. One per line.'] - moderatorsStr += \ - ' ' - moderatorsStr += '
' + moderators = '' + moderatorsFile = baseDir + '/accounts/moderators.txt' + if os.path.isfile(moderatorsFile): + with open(moderatorsFile, "r") as f: + moderators = f.read() + moderatorsStr = '
' + moderatorsStr += ' ' + translate['Moderators'] + '
' + moderatorsStr += ' ' + \ + translate['A list of moderator nicknames. One per line.'] + moderatorsStr += \ + ' ' + moderatorsStr += '
' - themes = getThemesList() - themesDropdown = '
' - themesDropdown += ' ' + translate['Theme'] + '
' - grayscaleFilename = \ - baseDir + '/accounts/.grayscale' - grayscale = '' - if os.path.isfile(grayscaleFilename): - grayscale = 'checked' - themesDropdown += \ - ' ' + translate['Grayscale'] + '
' - themesDropdown += '
' - if os.path.isfile(baseDir + '/fonts/custom.woff') or \ - os.path.isfile(baseDir + '/fonts/custom.woff2') or \ - os.path.isfile(baseDir + '/fonts/custom.otf') or \ - os.path.isfile(baseDir + '/fonts/custom.ttf'): + themes = getThemesList() + themesDropdown = '
' + themesDropdown += ' ' + translate['Theme'] + '
' + grayscaleFilename = \ + baseDir + '/accounts/.grayscale' + grayscale = '' + if os.path.isfile(grayscaleFilename): + grayscale = 'checked' themesDropdown += \ ' ' + \ - translate['Remove the custom font'] + '
' - themesDropdown += '
' - themeName = getConfigParam(baseDir, 'theme') - themesDropdown = \ - themesDropdown.replace('
' + themeName = getConfigParam(baseDir, 'theme') + themesDropdown = \ + themesDropdown.replace('