mirror of https://gitlab.com/bashrc2/epicyon
Function for git projects section of edit profile screen
parent
43e6f9d0d6
commit
aaa71b542e
|
@ -1386,6 +1386,33 @@ def _htmlEditProfileSkills(baseDir: str, nickname: str, domain: str,
|
||||||
return editProfileForm
|
return editProfileForm
|
||||||
|
|
||||||
|
|
||||||
|
def _htmlEditProfileGitProjects(baseDir: str, nickname: str, domain: str,
|
||||||
|
translate: {}) -> str:
|
||||||
|
"""git projects section of edit profile screen
|
||||||
|
"""
|
||||||
|
gitProjectsStr = ''
|
||||||
|
gitProjectsFilename = \
|
||||||
|
baseDir + '/accounts/' + \
|
||||||
|
nickname + '@' + domain + '/gitprojects.txt'
|
||||||
|
if os.path.isfile(gitProjectsFilename):
|
||||||
|
with open(gitProjectsFilename, 'r') as gitProjectsFile:
|
||||||
|
gitProjectsStr = gitProjectsFile.read()
|
||||||
|
|
||||||
|
editProfileForm = '<details><summary class="cw">' + \
|
||||||
|
translate['Git Projects'] + '</summary>\n'
|
||||||
|
editProfileForm += ' <div class="container">\n'
|
||||||
|
idx = 'List of project names that you wish to receive git patches for'
|
||||||
|
editProfileForm += \
|
||||||
|
' <label class="labels">' + \
|
||||||
|
translate[idx] + '</label>\n'
|
||||||
|
editProfileForm += \
|
||||||
|
' <textarea id="message" name="gitProjects" ' + \
|
||||||
|
'style="height:100px" spellcheck="false">' + \
|
||||||
|
gitProjectsStr + '</textarea>\n'
|
||||||
|
editProfileForm += ' </div></details>\n'
|
||||||
|
return editProfileForm
|
||||||
|
|
||||||
|
|
||||||
def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
domain: str, port: int, httpPrefix: str,
|
domain: str, port: int, httpPrefix: str,
|
||||||
defaultTimeline: str, theme: str,
|
defaultTimeline: str, theme: str,
|
||||||
|
@ -1542,14 +1569,6 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
with open(allowedInstancesFilename, 'r') as allowedInstancesFile:
|
with open(allowedInstancesFilename, 'r') as allowedInstancesFile:
|
||||||
allowedInstancesStr = allowedInstancesFile.read()
|
allowedInstancesStr = allowedInstancesFile.read()
|
||||||
|
|
||||||
gitProjectsStr = ''
|
|
||||||
gitProjectsFilename = \
|
|
||||||
baseDir + '/accounts/' + \
|
|
||||||
nickname + '@' + domain + '/gitprojects.txt'
|
|
||||||
if os.path.isfile(gitProjectsFilename):
|
|
||||||
with open(gitProjectsFilename, 'r') as gitProjectsFile:
|
|
||||||
gitProjectsStr = gitProjectsFile.read()
|
|
||||||
|
|
||||||
cssFilename = baseDir + '/epicyon-profile.css'
|
cssFilename = baseDir + '/epicyon-profile.css'
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
@ -1951,19 +1970,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
editProfileForm += ' </div></details>\n'
|
editProfileForm += ' </div></details>\n'
|
||||||
|
|
||||||
# git projects section
|
# git projects section
|
||||||
editProfileForm += '<details><summary class="cw">' + \
|
|
||||||
translate['Git Projects'] + '</summary>\n'
|
|
||||||
editProfileForm += ' <div class="container">\n'
|
|
||||||
idx = 'List of project names that you wish to receive git patches for'
|
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
' <label class="labels">' + \
|
_htmlEditProfileGitProjects(baseDir, nickname, domain, translate)
|
||||||
translate[idx] + '</label>\n'
|
|
||||||
editProfileForm += \
|
|
||||||
' <textarea id="message" name="gitProjects" ' + \
|
|
||||||
'style="height:100px" spellcheck="false">' + \
|
|
||||||
gitProjectsStr + '</textarea>\n'
|
|
||||||
|
|
||||||
editProfileForm += ' </div></details>\n'
|
|
||||||
|
|
||||||
# Skills section
|
# Skills section
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
|
|
Loading…
Reference in New Issue