mirror of https://gitlab.com/bashrc2/epicyon
Move theme selection into instance section
parent
ea734f37ab
commit
3dc7887a35
|
@ -1273,6 +1273,41 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
instanceStr += \
|
instanceStr += \
|
||||||
' <input type="file" id="instanceLogo" name="instanceLogo"'
|
' <input type="file" id="instanceLogo" name="instanceLogo"'
|
||||||
instanceStr += ' accept="' + imageFormats + '"><br>\n'
|
instanceStr += ' accept="' + imageFormats + '"><br>\n'
|
||||||
|
|
||||||
|
# Themes section
|
||||||
|
themes = getThemesList(baseDir)
|
||||||
|
themesDropdown += ' <br><b><label class="labels">' + \
|
||||||
|
translate['Theme'] + '</label></b><br>\n'
|
||||||
|
grayscaleFilename = \
|
||||||
|
baseDir + '/accounts/.grayscale'
|
||||||
|
grayscale = ''
|
||||||
|
if os.path.isfile(grayscaleFilename):
|
||||||
|
grayscale = 'checked'
|
||||||
|
themesDropdown += \
|
||||||
|
' <input type="checkbox" class="profilecheckbox" ' + \
|
||||||
|
'name="grayscale" ' + grayscale + \
|
||||||
|
'> ' + translate['Grayscale'] + '<br>'
|
||||||
|
themesDropdown += ' <select id="themeDropdown" ' + \
|
||||||
|
'name="themeDropdown" class="theme">'
|
||||||
|
for themeName in themes:
|
||||||
|
themesDropdown += ' <option value="' + \
|
||||||
|
themeName.lower() + '">' + \
|
||||||
|
translate[themeName] + '</option>'
|
||||||
|
themesDropdown += ' </select><br>'
|
||||||
|
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 += \
|
||||||
|
' <input type="checkbox" class="profilecheckbox" ' + \
|
||||||
|
'name="removeCustomFont"> ' + \
|
||||||
|
translate['Remove the custom font'] + '<br>'
|
||||||
|
themeName = getConfigParam(baseDir, 'theme')
|
||||||
|
themesDropdown = \
|
||||||
|
themesDropdown.replace('<option value="' + themeName + '">',
|
||||||
|
'<option value="' + themeName +
|
||||||
|
'" selected>')
|
||||||
|
instanceStr += themesDropdown
|
||||||
instanceStr += \
|
instanceStr += \
|
||||||
' <br><label class="labels">' + \
|
' <br><label class="labels">' + \
|
||||||
translate['Security'] + '</label><br>\n'
|
translate['Security'] + '</label><br>\n'
|
||||||
|
@ -1315,42 +1350,6 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
translate['This is a news instance'] + '<br>\n'
|
translate['This is a news instance'] + '<br>\n'
|
||||||
instanceStr += ' </div>\n'
|
instanceStr += ' </div>\n'
|
||||||
|
|
||||||
# Themes section
|
|
||||||
themes = getThemesList(baseDir)
|
|
||||||
themesDropdown = '<div class="container">'
|
|
||||||
themesDropdown += ' <b><label class="labels">' + \
|
|
||||||
translate['Theme'] + '</label></b><br>\n'
|
|
||||||
grayscaleFilename = \
|
|
||||||
baseDir + '/accounts/.grayscale'
|
|
||||||
grayscale = ''
|
|
||||||
if os.path.isfile(grayscaleFilename):
|
|
||||||
grayscale = 'checked'
|
|
||||||
themesDropdown += \
|
|
||||||
' <input type="checkbox" class="profilecheckbox" ' + \
|
|
||||||
'name="grayscale" ' + grayscale + \
|
|
||||||
'> ' + translate['Grayscale'] + '<br>'
|
|
||||||
themesDropdown += ' <select id="themeDropdown" ' + \
|
|
||||||
'name="themeDropdown" class="theme">'
|
|
||||||
for themeName in themes:
|
|
||||||
themesDropdown += ' <option value="' + \
|
|
||||||
themeName.lower() + '">' + \
|
|
||||||
translate[themeName] + '</option>'
|
|
||||||
themesDropdown += ' </select><br>'
|
|
||||||
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 += \
|
|
||||||
' <input type="checkbox" class="profilecheckbox" ' + \
|
|
||||||
'name="removeCustomFont"> ' + \
|
|
||||||
translate['Remove the custom font'] + '<br>'
|
|
||||||
themesDropdown += ' </div>\n'
|
|
||||||
themeName = getConfigParam(baseDir, 'theme')
|
|
||||||
themesDropdown = \
|
|
||||||
themesDropdown.replace('<option value="' + themeName + '">',
|
|
||||||
'<option value="' + themeName +
|
|
||||||
'" selected>')
|
|
||||||
|
|
||||||
# Role assignments section
|
# Role assignments section
|
||||||
moderators = ''
|
moderators = ''
|
||||||
moderatorsFile = baseDir + '/accounts/moderators.txt'
|
moderatorsFile = baseDir + '/accounts/moderators.txt'
|
||||||
|
@ -1735,8 +1734,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
editProfileForm += ' <label class="labels">' + \
|
editProfileForm += ' <label class="labels">' + \
|
||||||
translate[idx] + '</label>\n'
|
translate[idx] + '</label>\n'
|
||||||
editProfileForm += skillsStr
|
editProfileForm += skillsStr
|
||||||
editProfileForm += themesDropdown + roleAssignStr
|
editProfileForm += roleAssignStr + peertubeStr + instanceStr
|
||||||
editProfileForm += peertubeStr + instanceStr
|
|
||||||
editProfileForm += ' <div class="container">\n'
|
editProfileForm += ' <div class="container">\n'
|
||||||
editProfileForm += ' <b><label class="labels">' + \
|
editProfileForm += ' <b><label class="labels">' + \
|
||||||
translate['Danger Zone'] + '</label></b><br>\n'
|
translate['Danger Zone'] + '</label></b><br>\n'
|
||||||
|
|
Loading…
Reference in New Issue