mirror of https://gitlab.com/bashrc2/epicyon
Admin can set instance metadata and logo from their profile screen
parent
babeba65c1
commit
dcefca19b0
24
daemon.py
24
daemon.py
|
@ -3221,7 +3221,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
# extract each image type
|
# extract each image type
|
||||||
actorChanged=True
|
actorChanged=True
|
||||||
profileMediaTypes=['avatar','image','banner']
|
profileMediaTypes=['avatar','image','banner','instanceLogo']
|
||||||
for mType in profileMediaTypes:
|
for mType in profileMediaTypes:
|
||||||
if self.server.debug:
|
if self.server.debug:
|
||||||
print('DEBUG: profile update extracting '+mType+' image from POST')
|
print('DEBUG: profile update extracting '+mType+' image from POST')
|
||||||
|
@ -3236,9 +3236,13 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
# Note: a .temp extension is used here so that at no time is
|
# Note: a .temp extension is used here so that at no time is
|
||||||
# an image with metadata publicly exposed, even for a few mS
|
# an image with metadata publicly exposed, even for a few mS
|
||||||
filenameBase= \
|
if mType!='instanceLogo':
|
||||||
self.server.baseDir+'/accounts/'+ \
|
filenameBase= \
|
||||||
nickname+'@'+self.server.domain+'/'+mType+'.temp'
|
self.server.baseDir+'/accounts/'+ \
|
||||||
|
nickname+'@'+self.server.domain+'/'+mType+'.temp'
|
||||||
|
else:
|
||||||
|
filenameBase= \
|
||||||
|
self.server.baseDir+'/accounts/logo.temp'
|
||||||
|
|
||||||
filename,attachmentMediaType= \
|
filename,attachmentMediaType= \
|
||||||
saveMediaInFormPOST(mediaBytes,self.server.debug,filenameBase)
|
saveMediaInFormPOST(mediaBytes,self.server.debug,filenameBase)
|
||||||
|
@ -3309,6 +3313,18 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if fields['donateUrl']!=currentDonateUrl:
|
if fields['donateUrl']!=currentDonateUrl:
|
||||||
setDonationUrl(actorJson,fields['donateUrl'])
|
setDonationUrl(actorJson,fields['donateUrl'])
|
||||||
actorChanged=True
|
actorChanged=True
|
||||||
|
if fields.get('instanceTitle'):
|
||||||
|
currInstanceTitle=getConfigParam(self.server.baseDir,'instanceTitle')
|
||||||
|
if fields['instanceTitle']!=currInstanceTitle:
|
||||||
|
setConfigParam(self.server.baseDir,'instanceTitle',fields['instanceTitle'])
|
||||||
|
if fields.get('instanceDescriptionShort'):
|
||||||
|
currInstanceDescriptionShort=getConfigParam(self.server.baseDir,'instanceDescriptionShort')
|
||||||
|
if fields['instanceDescriptionShort']!=currInstanceDescriptionShort:
|
||||||
|
setConfigParam(self.server.baseDir,'instanceDescriptionShort',fields['instanceDescriptionShort'])
|
||||||
|
if fields.get('instanceDescription'):
|
||||||
|
currInstanceDescription=getConfigParam(self.server.baseDir,'instanceDescription')
|
||||||
|
if fields['instanceDescription']!=currInstanceDescription:
|
||||||
|
setConfigParam(self.server.baseDir,'instanceDescription',fields['instanceDescription'])
|
||||||
if fields.get('bio'):
|
if fields.get('bio'):
|
||||||
if fields['bio']!=actorJson['summary']:
|
if fields['bio']!=actorJson['summary']:
|
||||||
actorTags={}
|
actorTags={}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "رابط التبرعات",
|
"Donations link": "رابط التبرعات",
|
||||||
"Donate": "تبرع",
|
"Donate": "تبرع",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "Enllaç de donacions",
|
"Donations link": "Enllaç de donacions",
|
||||||
"Donate": "Donar",
|
"Donate": "Donar",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "Dolen rhoddion",
|
"Donations link": "Dolen rhoddion",
|
||||||
"Donate": "Cyfrannu",
|
"Donate": "Cyfrannu",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "Spenden Link",
|
"Donations link": "Spenden Link",
|
||||||
"Donate": "Spenden",
|
"Donate": "Spenden",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "Donations link",
|
"Donations link": "Donations link",
|
||||||
"Donate": "Donate",
|
"Donate": "Donate",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "Enlace de donaciones",
|
"Donations link": "Enlace de donaciones",
|
||||||
"Donate": "Donar",
|
"Donate": "Donar",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "Lien vers les dons",
|
"Donations link": "Lien vers les dons",
|
||||||
"Donate": "Faire un don",
|
"Donate": "Faire un don",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "Nasc síntiús",
|
"Donations link": "Nasc síntiús",
|
||||||
"Donate": "Síntiús",
|
"Donate": "Síntiús",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "दान लिंक",
|
"Donations link": "दान लिंक",
|
||||||
"Donate": "दान करना",
|
"Donate": "दान करना",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "Link alle donazioni",
|
"Donations link": "Link alle donazioni",
|
||||||
"Donate": "Donare",
|
"Donate": "Donare",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "寄付リンク",
|
"Donations link": "寄付リンク",
|
||||||
"Donate": "寄付する",
|
"Donate": "寄付する",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,5 +169,9 @@
|
||||||
"Show profile": "Veire lo perfil",
|
"Show profile": "Veire lo perfil",
|
||||||
"SHOW MORE": "NE VEIRE MAI",
|
"SHOW MORE": "NE VEIRE MAI",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "Link de doações",
|
"Donations link": "Link de doações",
|
||||||
"Donate": "Doar",
|
"Donate": "Doar",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "Ссылка на пожертвования",
|
"Donations link": "Ссылка на пожертвования",
|
||||||
"Donate": "жертвовать",
|
"Donate": "жертвовать",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,9 @@
|
||||||
"Donations link": "捐款连结",
|
"Donations link": "捐款连结",
|
||||||
"Donate": "捐",
|
"Donate": "捐",
|
||||||
"Change Password": "Change Password",
|
"Change Password": "Change Password",
|
||||||
"Confirm Password": "Confirm Password"
|
"Confirm Password": "Confirm Password",
|
||||||
|
"Instance Title": "Instance Title",
|
||||||
|
"Instance Short Description": "Instance Short Description",
|
||||||
|
"Instance Description": "Instance Description",
|
||||||
|
"Instance Logo": "Instance Logo"
|
||||||
}
|
}
|
||||||
|
|
|
@ -585,9 +585,25 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int)
|
||||||
with open(cssFilename, 'r') as cssFile:
|
with open(cssFilename, 'r') as cssFile:
|
||||||
editProfileCSS = cssFile.read()
|
editProfileCSS = cssFile.read()
|
||||||
|
|
||||||
|
instanceStr=''
|
||||||
moderatorsStr=''
|
moderatorsStr=''
|
||||||
adminNickname=getConfigParam(baseDir,'admin')
|
adminNickname=getConfigParam(baseDir,'admin')
|
||||||
if path.startswith('/users/'+adminNickname+'/'):
|
if path.startswith('/users/'+adminNickname+'/'):
|
||||||
|
instanceDescription=getConfigParam(baseDir,'instanceDescription')
|
||||||
|
instanceDescriptionShort=getConfigParam(baseDir,'instanceDescriptionShort')
|
||||||
|
instanceTitle=getConfigParam(baseDir,'instanceTitle')
|
||||||
|
instanceStr='<div class="container">'
|
||||||
|
instanceStr+=' '+translate['Instance Title']
|
||||||
|
instanceStr+=' <input type="text" name="instanceTitle" value="'+instanceTitle+'">'
|
||||||
|
instanceStr+=' '+translate['Instance Short Description']
|
||||||
|
instanceStr+=' <input type="text" name="instanceDescriptionShort" value="'+instanceDescriptionShort+'">'
|
||||||
|
instanceStr+=' '+translate['Instance Description']
|
||||||
|
instanceStr+=' <textarea id="message" name="instanceDescription" style="height:200px">'+instanceDescription+'</textarea>'
|
||||||
|
instanceStr+=' '+translate['Instance Logo']
|
||||||
|
instanceStr+=' <input type="file" id="instanceLogo" name="instanceLogo"'
|
||||||
|
instanceStr+=' accept=".png">'
|
||||||
|
instanceStr+='</div>'
|
||||||
|
|
||||||
moderators=''
|
moderators=''
|
||||||
moderatorsFile=baseDir+'/accounts/moderators.txt'
|
moderatorsFile=baseDir+'/accounts/moderators.txt'
|
||||||
if os.path.isfile(moderatorsFile):
|
if os.path.isfile(moderatorsFile):
|
||||||
|
@ -650,7 +666,7 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int)
|
||||||
editProfileForm+=' <b>'+translate['Skills']+'</b><br>'
|
editProfileForm+=' <b>'+translate['Skills']+'</b><br>'
|
||||||
editProfileForm+=' '+translate['If you want to participate within organizations then you can indicate some skills that you have and approximate proficiency levels. This helps organizers to construct teams with an appropriate combination of skills.']
|
editProfileForm+=' '+translate['If you want to participate within organizations then you can indicate some skills that you have and approximate proficiency levels. This helps organizers to construct teams with an appropriate combination of skills.']
|
||||||
editProfileForm+=skillsStr+moderatorsStr
|
editProfileForm+=skillsStr+moderatorsStr
|
||||||
editProfileForm+=' </div>'
|
editProfileForm+=' </div>'+instanceStr
|
||||||
editProfileForm+=' <div class="container">'
|
editProfileForm+=' <div class="container">'
|
||||||
editProfileForm+=' <b>'+translate['Danger Zone']+'</b><br>'
|
editProfileForm+=' <b>'+translate['Danger Zone']+'</b><br>'
|
||||||
editProfileForm+=' <input type="checkbox" class=dangercheckbox" name="deactivateThisAccount">'+translate['Deactivate this account']+'<br>'
|
editProfileForm+=' <input type="checkbox" class=dangercheckbox" name="deactivateThisAccount">'+translate['Deactivate this account']+'<br>'
|
||||||
|
|
Loading…
Reference in New Issue