diff --git a/webapp_profile.py b/webapp_profile.py index a2a0a53a8..a511734b1 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -1273,6 +1273,41 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, instanceStr += \ ' \n' + + # Themes section + themes = getThemesList(baseDir) + themesDropdown += ' ' + \ + translate['Theme'] + '\n' + grayscaleFilename = \ + baseDir + '/accounts/.grayscale' + grayscale = '' + if os.path.isfile(grayscaleFilename): + grayscale = 'checked' + themesDropdown += \ + ' ' + translate['Grayscale'] + '' + themesDropdown += ' ' + for themeName in themes: + themesDropdown += ' ' + \ + translate[themeName] + '' + 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'): + themesDropdown += \ + ' ' + \ + translate['Remove the custom font'] + '' + themeName = getConfigParam(baseDir, 'theme') + themesDropdown = \ + themesDropdown.replace('', + '') + instanceStr += themesDropdown instanceStr += \ ' ' + \ translate['Security'] + '\n' @@ -1315,42 +1350,6 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, translate['This is a news instance'] + '\n' instanceStr += ' \n' - # Themes section - themes = getThemesList(baseDir) - themesDropdown = '' - themesDropdown += ' ' + \ - translate['Theme'] + '\n' - grayscaleFilename = \ - baseDir + '/accounts/.grayscale' - grayscale = '' - if os.path.isfile(grayscaleFilename): - grayscale = 'checked' - themesDropdown += \ - ' ' + translate['Grayscale'] + '' - themesDropdown += ' ' - for themeName in themes: - themesDropdown += ' ' + \ - translate[themeName] + '' - 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'): - themesDropdown += \ - ' ' + \ - translate['Remove the custom font'] + '' - themesDropdown += ' \n' - themeName = getConfigParam(baseDir, 'theme') - themesDropdown = \ - themesDropdown.replace('', - '') - # Role assignments section moderators = '' moderatorsFile = baseDir + '/accounts/moderators.txt' @@ -1735,8 +1734,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, editProfileForm += ' ' + \ translate[idx] + '\n' editProfileForm += skillsStr - editProfileForm += themesDropdown + roleAssignStr - editProfileForm += peertubeStr + instanceStr + editProfileForm += roleAssignStr + peertubeStr + instanceStr editProfileForm += ' \n' editProfileForm += ' ' + \ translate['Danger Zone'] + '\n'