Add line endings

merge-requests/8/head
Bob Mottram 2020-08-12 09:40:18 +00:00
parent 995adf0ceb
commit 5d0d8b1ddc
1 changed files with 95 additions and 93 deletions

View File

@ -1306,240 +1306,242 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
editProfileForm = htmlHeader(cssFilename, editProfileCSS) editProfileForm = htmlHeader(cssFilename, editProfileCSS)
editProfileForm += \ editProfileForm += \
'<form enctype="multipart/form-data" method="POST" ' + \ '<form enctype="multipart/form-data" method="POST" ' + \
'accept-charset="UTF-8" action="' + path + '/profiledata">' 'accept-charset="UTF-8" action="' + path + '/profiledata">\n'
editProfileForm += ' <div class="vertical-center">' editProfileForm += ' <div class="vertical-center">\n'
editProfileForm += \ editProfileForm += \
' <p class="new-post-text">' + translate['Profile for'] + \ ' <p class="new-post-text">' + translate['Profile for'] + \
' ' + nickname + '@' + domainFull + '</p>' ' ' + nickname + '@' + domainFull + '</p>'
editProfileForm += ' <div class="container">' editProfileForm += ' <div class="container">\n'
editProfileForm += \
' <input type="submit" name="submitProfile" value="' + \
translate['Submit'] + '">'
editProfileForm += \ editProfileForm += \
' <a href="' + pathOriginal + '"><button class="cancelbtn">' + \ ' <a href="' + pathOriginal + '"><button class="cancelbtn">' + \
translate['Cancel'] + '</button></a>' translate['Go Back'] + '</button></a>\n'
editProfileForm += ' </div>' editProfileForm += \
' <input type="submit" name="submitProfile" value="' + \
translate['Submit'] + '">\n'
editProfileForm += ' </div>\n'
if scheduledPostsExist(baseDir, nickname, domain): if scheduledPostsExist(baseDir, nickname, domain):
editProfileForm += ' <div class="container">' editProfileForm += ' <div class="container">\n'
editProfileForm += \ editProfileForm += \
' <input type="checkbox" class="profilecheckbox" ' + \ ' <input type="checkbox" class="profilecheckbox" ' + \
'name="removeScheduledPosts"> ' + \ 'name="removeScheduledPosts"> ' + \
translate['Remove scheduled posts'] + '<br>' translate['Remove scheduled posts'] + '<br>\n'
editProfileForm += ' </div>' editProfileForm += ' </div>\n'
editProfileForm += ' <div class="container">' editProfileForm += ' <div class="container">\n'
editProfileForm += ' <label class="labels">' + \ editProfileForm += ' <label class="labels">' + \
translate['Nickname'] + '</label>' translate['Nickname'] + '</label>\n'
editProfileForm += \ editProfileForm += \
' <input type="text" name="displayNickname" value="' + \ ' <input type="text" name="displayNickname" value="' + \
displayNickname + '"><br>' displayNickname + '"><br>\n'
editProfileForm += \ editProfileForm += \
' <label class="labels">' + translate['Your bio'] + '</label>' ' <label class="labels">' + translate['Your bio'] + '</label>\n'
editProfileForm += \ editProfileForm += \
' <textarea id="message" name="bio" style="height:200px">' + \ ' <textarea id="message" name="bio" style="height:200px">' + \
bioStr + '</textarea>' bioStr + '</textarea>\n'
editProfileForm += '<label class="labels">' + \ editProfileForm += '<label class="labels">' + \
translate['Donations link'] + '</label><br>' translate['Donations link'] + '</label><br>\n'
editProfileForm += \ editProfileForm += \
' <input type="text" placeholder="https://..." ' + \ ' <input type="text" placeholder="https://..." ' + \
'name="donateUrl" value="' + donateUrl + '">' 'name="donateUrl" value="' + donateUrl + '">\n'
editProfileForm += \ editProfileForm += \
'<label class="labels">' + translate['XMPP'] + '</label><br>' '<label class="labels">' + translate['XMPP'] + '</label><br>\n'
editProfileForm += \ editProfileForm += \
' <input type="text" name="xmppAddress" value="' + \ ' <input type="text" name="xmppAddress" value="' + \
xmppAddress + '">' xmppAddress + '">\n'
editProfileForm += '<label class="labels">' + \ editProfileForm += '<label class="labels">' + \
translate['Matrix'] + '</label><br>' translate['Matrix'] + '</label><br>\n'
editProfileForm += \ editProfileForm += \
' <input type="text" name="matrixAddress" value="' + \ ' <input type="text" name="matrixAddress" value="' + \
matrixAddress+'">' matrixAddress+'">\n'
editProfileForm += '<label class="labels">SSB</label><br>' editProfileForm += '<label class="labels">SSB</label><br>\n'
editProfileForm += \ editProfileForm += \
' <input type="text" name="ssbAddress" value="' + \ ' <input type="text" name="ssbAddress" value="' + \
ssbAddress + '">' ssbAddress + '">\n'
editProfileForm += '<label class="labels">Blog</label><br>' editProfileForm += '<label class="labels">Blog</label><br>\n'
editProfileForm += \ editProfileForm += \
' <input type="text" name="blogAddress" value="' + \ ' <input type="text" name="blogAddress" value="' + \
blogAddress + '">' blogAddress + '">\n'
editProfileForm += '<label class="labels">Tox</label><br>' editProfileForm += '<label class="labels">Tox</label><br>\n'
editProfileForm += \ editProfileForm += \
' <input type="text" name="toxAddress" value="' + \ ' <input type="text" name="toxAddress" value="' + \
toxAddress + '">' toxAddress + '">\n'
editProfileForm += '<label class="labels">' + \ editProfileForm += '<label class="labels">' + \
translate['Email'] + '</label><br>' translate['Email'] + '</label><br>\n'
editProfileForm += \ editProfileForm += \
' <input type="text" name="email" value="' + emailAddress + '">' ' <input type="text" name="email" value="' + emailAddress + '">\n'
editProfileForm += \ editProfileForm += \
'<label class="labels">' + \ '<label class="labels">' + \
translate['PGP Fingerprint'] + '</label><br>' translate['PGP Fingerprint'] + '</label><br>\n'
editProfileForm += \ editProfileForm += \
' <input type="text" name="openpgp" value="' + \ ' <input type="text" name="openpgp" value="' + \
PGPfingerprint + '">' PGPfingerprint + '">\n'
editProfileForm += \ editProfileForm += \
'<label class="labels">' + translate['PGP'] + '</label><br>' '<label class="labels">' + translate['PGP'] + '</label><br>\n'
editProfileForm += \ editProfileForm += \
' <textarea id="message" placeholder=' + \ ' <textarea id="message" placeholder=' + \
'"-----BEGIN PGP PUBLIC KEY BLOCK-----" name="pgp" ' + \ '"-----BEGIN PGP PUBLIC KEY BLOCK-----" name="pgp" ' + \
'style="height:100px">' + PGPpubKey + '</textarea>' 'style="height:100px">' + PGPpubKey + '</textarea>\n'
editProfileForm += '<a href="/users/' + nickname + \ editProfileForm += '<a href="/users/' + nickname + \
'/followingaccounts"><label class="labels">' + \ '/followingaccounts"><label class="labels">' + \
translate['Following'] + '</label></a><br>' translate['Following'] + '</label></a><br>\n'
editProfileForm += ' </div>' editProfileForm += ' </div>\n'
editProfileForm += ' <div class="container">' editProfileForm += ' <div class="container">\n'
idx = 'The files attached below should be no larger than ' + \ idx = 'The files attached below should be no larger than ' + \
'10MB in total uploaded at once.' '10MB in total uploaded at once.'
editProfileForm += \ editProfileForm += \
' <label class="labels">' + translate[idx] + '</label><br><br>' ' <label class="labels">' + translate[idx] + '</label><br><br>\n'
editProfileForm += \ editProfileForm += \
' <label class="labels">' + translate['Avatar image'] + '</label>' ' <label class="labels">' + translate['Avatar image'] + \
'</label>\n'
editProfileForm += \ editProfileForm += \
' <input type="file" id="avatar" name="avatar"' ' <input type="file" id="avatar" name="avatar"'
editProfileForm += ' accept="' + imageFormats + '">' editProfileForm += ' accept="' + imageFormats + '">\n'
editProfileForm += \ editProfileForm += \
' <br><label class="labels">' + \ ' <br><label class="labels">' + \
translate['Background image'] + '</label>' translate['Background image'] + '</label>\n'
editProfileForm += ' <input type="file" id="image" name="image"' editProfileForm += ' <input type="file" id="image" name="image"'
editProfileForm += ' accept="' + imageFormats + '">' editProfileForm += ' accept="' + imageFormats + '">\n'
editProfileForm += ' <br><label class="labels">' + \ editProfileForm += ' <br><label class="labels">' + \
translate['Timeline banner image'] + '</label>' translate['Timeline banner image'] + '</label>\n'
editProfileForm += ' <input type="file" id="banner" name="banner"' editProfileForm += ' <input type="file" id="banner" name="banner"'
editProfileForm += ' accept="' + imageFormats + '">' editProfileForm += ' accept="' + imageFormats + '">\n'
editProfileForm += ' <br><label class="labels">' + \ editProfileForm += ' <br><label class="labels">' + \
translate['Search banner image'] + '</label>' translate['Search banner image'] + '</label>\n'
editProfileForm += ' <input type="file" id="search_banner" ' editProfileForm += ' <input type="file" id="search_banner" '
editProfileForm += 'name="search_banner"' editProfileForm += 'name="search_banner"'
editProfileForm += ' accept="' + imageFormats + '">' editProfileForm += ' accept="' + imageFormats + '">\n'
editProfileForm += ' </div>' editProfileForm += ' </div>\n'
editProfileForm += ' <div class="container">' editProfileForm += ' <div class="container">\n'
editProfileForm += \ editProfileForm += \
'<label class="labels">' + translate['Change Password'] + \ '<label class="labels">' + translate['Change Password'] + \
'</label><br>' '</label><br>\n'
editProfileForm += ' <input type="text" name="password" value=""><br>' editProfileForm += ' <input type="text" name="password" ' + \
'value=""><br>\n'
editProfileForm += \ editProfileForm += \
'<label class="labels">' + translate['Confirm Password'] + \ '<label class="labels">' + translate['Confirm Password'] + \
'</label><br>' '</label><br>\n'
editProfileForm += \ editProfileForm += \
' <input type="text" name="passwordconfirm" value="">' ' <input type="text" name="passwordconfirm" value="">\n'
editProfileForm += ' </div>' editProfileForm += ' </div>\n'
editProfileForm += ' <div class="container">' editProfileForm += ' <div class="container">\n'
editProfileForm += \ editProfileForm += \
' <input type="checkbox" class="profilecheckbox" ' + \ ' <input type="checkbox" class="profilecheckbox" ' + \
'name="approveFollowers" ' + manuallyApprovesFollowers + \ 'name="approveFollowers" ' + manuallyApprovesFollowers + \
'> ' + translate['Approve follower requests'] + '<br>' '> ' + translate['Approve follower requests'] + '<br>\n'
editProfileForm += \ editProfileForm += \
' <input type="checkbox" ' + \ ' <input type="checkbox" ' + \
'class="profilecheckbox" name="isBot" ' + \ 'class="profilecheckbox" name="isBot" ' + \
isBot + '> ' + translate['This is a bot account'] + '<br>' isBot + '> ' + translate['This is a bot account'] + '<br>\n'
editProfileForm += \ editProfileForm += \
' <input type="checkbox" ' + \ ' <input type="checkbox" ' + \
'class="profilecheckbox" name="isGroup" ' + isGroup + '> ' + \ 'class="profilecheckbox" name="isGroup" ' + isGroup + '> ' + \
translate['This is a group account'] + '<br>' translate['This is a group account'] + '<br>\n'
editProfileForm += \ editProfileForm += \
' <input type="checkbox" class="profilecheckbox" ' + \ ' <input type="checkbox" class="profilecheckbox" ' + \
'name="followDMs" ' + followDMs + '> ' + \ 'name="followDMs" ' + followDMs + '> ' + \
translate['Only people I follow can send me DMs'] + '<br>' translate['Only people I follow can send me DMs'] + '<br>\n'
editProfileForm += \ editProfileForm += \
' <input type="checkbox" class="profilecheckbox" ' + \ ' <input type="checkbox" class="profilecheckbox" ' + \
'name="removeTwitter" ' + removeTwitter + '> ' + \ 'name="removeTwitter" ' + removeTwitter + '> ' + \
translate['Remove Twitter posts'] + '<br>' translate['Remove Twitter posts'] + '<br>\n'
if path.startswith('/users/' + adminNickname + '/'): if path.startswith('/users/' + adminNickname + '/'):
editProfileForm += \ editProfileForm += \
' <input type="checkbox" class="profilecheckbox" ' + \ ' <input type="checkbox" class="profilecheckbox" ' + \
'name="mediaInstance" ' + mediaInstanceStr + '> ' + \ 'name="mediaInstance" ' + mediaInstanceStr + '> ' + \
translate['This is a media instance'] + '<br>' translate['This is a media instance'] + '<br>\n'
editProfileForm += \ editProfileForm += \
' <br><b><label class="labels">' + \ ' <br><b><label class="labels">' + \
translate['Filtered words'] + '</label></b>' translate['Filtered words'] + '</label></b>\n'
editProfileForm += ' <br><label class="labels">' + \ editProfileForm += ' <br><label class="labels">' + \
translate['One per line'] + '</label>' translate['One per line'] + '</label>\n'
editProfileForm += ' <textarea id="message" ' + \ editProfileForm += ' <textarea id="message" ' + \
'name="filteredWords" style="height:200px">' + \ 'name="filteredWords" style="height:200px">' + \
filterStr + '</textarea>' filterStr + '</textarea>\n'
editProfileForm += \ editProfileForm += \
' <br><b><label class="labels">' + \ ' <br><b><label class="labels">' + \
translate['Word Replacements'] + '</label></b>' translate['Word Replacements'] + '</label></b>\n'
editProfileForm += ' <br><label class="labels">A -> B</label>' editProfileForm += ' <br><label class="labels">A -> B</label>\n'
editProfileForm += \ editProfileForm += \
' <textarea id="message" name="switchWords" ' + \ ' <textarea id="message" name="switchWords" ' + \
'style="height:200px">' + switchStr + '</textarea>' 'style="height:200px">' + switchStr + '</textarea>\n'
editProfileForm += \ editProfileForm += \
' <br><b><label class="labels">' + \ ' <br><b><label class="labels">' + \
translate['Blocked accounts'] + '</label></b>' translate['Blocked accounts'] + '</label></b>\n'
idx = 'Blocked accounts, one per line, in the form ' + \ idx = 'Blocked accounts, one per line, in the form ' + \
'nickname@domain or *@blockeddomain' 'nickname@domain or *@blockeddomain'
editProfileForm += \ editProfileForm += \
' <br><label class="labels">' + translate[idx] + '</label>' ' <br><label class="labels">' + translate[idx] + '</label>\n'
editProfileForm += \ editProfileForm += \
' <textarea id="message" name="blocked" style="height:200px">' + \ ' <textarea id="message" name="blocked" style="height:200px">' + \
blockedStr + '</textarea>' blockedStr + '</textarea>\n'
editProfileForm += \ editProfileForm += \
' <br><b><label class="labels">' + \ ' <br><b><label class="labels">' + \
translate['Federation list'] + '</label></b>' translate['Federation list'] + '</label></b>\n'
idx = 'Federate only with a defined set of instances. ' + \ idx = 'Federate only with a defined set of instances. ' + \
'One domain name per line.' 'One domain name per line.'
editProfileForm += \ editProfileForm += \
' <br><label class="labels">' + \ ' <br><label class="labels">' + \
translate[idx] + '</label>' translate[idx] + '</label>\n'
editProfileForm += \ editProfileForm += \
' <textarea id="message" name="allowedInstances" ' + \ ' <textarea id="message" name="allowedInstances" ' + \
'style="height:200px">' + allowedInstancesStr + '</textarea>' 'style="height:200px">' + allowedInstancesStr + '</textarea>\n'
editProfileForm += \ editProfileForm += \
' <br><b><label class="labels">' + \ ' <br><b><label class="labels">' + \
translate['Git Projects'] + '</label></b>' translate['Git Projects'] + '</label></b>\n'
idx = 'List of project names that you wish to receive git patches for' idx = 'List of project names that you wish to receive git patches for'
editProfileForm += \ editProfileForm += \
' <br><label class="labels">' + \ ' <br><label class="labels">' + \
translate[idx] + '</label>' translate[idx] + '</label>\n'
editProfileForm += \ editProfileForm += \
' <textarea id="message" name="gitProjects" ' + \ ' <textarea id="message" name="gitProjects" ' + \
'style="height:100px">' + gitProjectsStr + '</textarea>' 'style="height:100px">' + gitProjectsStr + '</textarea>\n'
editProfileForm += \ editProfileForm += \
' <br><b><label class="labels">' + \ ' <br><b><label class="labels">' + \
translate['YouTube Replacement Domain'] + '</label></b>' translate['YouTube Replacement Domain'] + '</label></b>\n'
YTReplacementDomain = getConfigParam(baseDir, "youtubedomain") YTReplacementDomain = getConfigParam(baseDir, "youtubedomain")
if not YTReplacementDomain: if not YTReplacementDomain:
YTReplacementDomain = '' YTReplacementDomain = ''
editProfileForm += \ editProfileForm += \
' <input type="text" name="ytdomain" value="' + \ ' <input type="text" name="ytdomain" value="' + \
YTReplacementDomain + '">' YTReplacementDomain + '">\n'
editProfileForm += ' </div>' editProfileForm += ' </div>\n'
editProfileForm += ' <div class="container">' editProfileForm += ' <div class="container">\n'
editProfileForm += \ editProfileForm += \
' <b><label class="labels">' + \ ' <b><label class="labels">' + \
translate['Skills'] + '</label></b><br>' translate['Skills'] + '</label></b><br>\n'
idx = 'If you want to participate within organizations then you ' + \ idx = 'If you want to participate within organizations then you ' + \
'can indicate some skills that you have and approximate ' + \ 'can indicate some skills that you have and approximate ' + \
'proficiency levels. This helps organizers to construct ' + \ 'proficiency levels. This helps organizers to construct ' + \
'teams with an appropriate combination of skills.' 'teams with an appropriate combination of skills.'
editProfileForm += ' <label class="labels">' + \ editProfileForm += ' <label class="labels">' + \
translate[idx] + '</label>' translate[idx] + '</label>\n'
editProfileForm += skillsStr + themesDropdown + moderatorsStr editProfileForm += skillsStr + themesDropdown + moderatorsStr
editProfileForm += ' </div>' + instanceStr editProfileForm += ' </div>\n' + instanceStr
editProfileForm += ' <div class="container">' editProfileForm += ' <div class="container">\n'
editProfileForm += ' <b><label class="labels">' + \ editProfileForm += ' <b><label class="labels">' + \
translate['Danger Zone'] + '</label></b><br>' translate['Danger Zone'] + '</label></b><br>\n'
editProfileForm += \ editProfileForm += \
' <input type="checkbox" class=dangercheckbox" ' + \ ' <input type="checkbox" class=dangercheckbox" ' + \
'name="deactivateThisAccount"> ' + \ 'name="deactivateThisAccount"> ' + \
translate['Deactivate this account'] + '<br>' translate['Deactivate this account'] + '<br>\n'
editProfileForm += ' </div>' editProfileForm += ' </div>\n'
editProfileForm += ' </div>' editProfileForm += ' </div>\n'
editProfileForm += '</form>' editProfileForm += '</form>\n'
editProfileForm += htmlFooter() editProfileForm += htmlFooter()
return editProfileForm return editProfileForm
@ -6244,10 +6246,10 @@ def htmlSearch(translate: {},
followStr += \ followStr += \
' <input type="hidden" name="actor" value="' + actor + '">\n' ' <input type="hidden" name="actor" value="' + actor + '">\n'
followStr += ' <input type="text" name="searchtext" autofocus><br>\n' followStr += ' <input type="text" name="searchtext" autofocus><br>\n'
followStr += ' <button type="submit" class="button" ' + \
'name="submitSearch">' + translate['Submit'] + '</button>\n'
followStr += ' <button type="submit" class="button" ' + \ followStr += ' <button type="submit" class="button" ' + \
'name="submitBack">' + translate['Go Back'] + '</button>\n' 'name="submitBack">' + translate['Go Back'] + '</button>\n'
followStr += ' <button type="submit" class="button" ' + \
'name="submitSearch">' + translate['Submit'] + '</button>\n'
followStr += ' </form>\n' followStr += ' </form>\n'
followStr += ' <p class="hashtagswarm">' + \ followStr += ' <p class="hashtagswarm">' + \
htmlHashTagSwarm(baseDir, actor) + '</p>\n' htmlHashTagSwarm(baseDir, actor) + '</p>\n'
@ -6440,15 +6442,15 @@ def htmlProfileAfterSearch(recentPostsCache: {}, maxRecentPosts: int,
profileStr += \ profileStr += \
' <input type="hidden" name="actor" value="' + \ ' <input type="hidden" name="actor" value="' + \
personUrl + '">\n' personUrl + '">\n'
profileStr += \
' <a href="' + backUrl + '"><button class="button">' + \
translate['Go Back'] + '</button></a>\n'
profileStr += \ profileStr += \
' <button type="submit" class="button" name="submitYes">' + \ ' <button type="submit" class="button" name="submitYes">' + \
translate['Follow'] + '</button>\n' translate['Follow'] + '</button>\n'
profileStr += \ profileStr += \
' <button type="submit" class="button" name="submitView">' + \ ' <button type="submit" class="button" name="submitView">' + \
translate['View'] + '</button>\n' translate['View'] + '</button>\n'
profileStr += \
' <a href="' + backUrl + '"><button class="button">' + \
translate['Go Back'] + '</button></a>\n'
profileStr += ' </center>\n' profileStr += ' </center>\n'
profileStr += ' </form>\n' profileStr += ' </form>\n'
profileStr += '</div>\n' profileStr += '</div>\n'