diff --git a/daemon.py b/daemon.py index 05cfbfe25..e8b601e60 100644 --- a/daemon.py +++ b/daemon.py @@ -3221,7 +3221,7 @@ class PubServer(BaseHTTPRequestHandler): # extract each image type actorChanged=True - profileMediaTypes=['avatar','image','banner'] + profileMediaTypes=['avatar','image','banner','instanceLogo'] for mType in profileMediaTypes: if self.server.debug: 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 # an image with metadata publicly exposed, even for a few mS - filenameBase= \ - self.server.baseDir+'/accounts/'+ \ - nickname+'@'+self.server.domain+'/'+mType+'.temp' + if mType!='instanceLogo': + filenameBase= \ + self.server.baseDir+'/accounts/'+ \ + nickname+'@'+self.server.domain+'/'+mType+'.temp' + else: + filenameBase= \ + self.server.baseDir+'/accounts/logo.temp' filename,attachmentMediaType= \ saveMediaInFormPOST(mediaBytes,self.server.debug,filenameBase) @@ -3309,6 +3313,18 @@ class PubServer(BaseHTTPRequestHandler): if fields['donateUrl']!=currentDonateUrl: setDonationUrl(actorJson,fields['donateUrl']) 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['bio']!=actorJson['summary']: actorTags={} diff --git a/translations/ar.json b/translations/ar.json index eaa071f71..611078c48 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -173,5 +173,9 @@ "Donations link": "رابط التبرعات", "Donate": "تبرع", "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" } diff --git a/translations/ca.json b/translations/ca.json index 3eaa8ea90..fe4743b44 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -173,5 +173,9 @@ "Donations link": "Enllaç de donacions", "Donate": "Donar", "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" } diff --git a/translations/cy.json b/translations/cy.json index 1a8257513..7ba591828 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -173,5 +173,9 @@ "Donations link": "Dolen rhoddion", "Donate": "Cyfrannu", "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" } diff --git a/translations/de.json b/translations/de.json index 3943134fc..a9127589e 100644 --- a/translations/de.json +++ b/translations/de.json @@ -173,5 +173,9 @@ "Donations link": "Spenden Link", "Donate": "Spenden", "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" } diff --git a/translations/en.json b/translations/en.json index f83ee038d..5b76afc7a 100644 --- a/translations/en.json +++ b/translations/en.json @@ -173,5 +173,9 @@ "Donations link": "Donations link", "Donate": "Donate", "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" } diff --git a/translations/es.json b/translations/es.json index 3500e66fb..437eff745 100644 --- a/translations/es.json +++ b/translations/es.json @@ -173,5 +173,9 @@ "Donations link": "Enlace de donaciones", "Donate": "Donar", "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" } diff --git a/translations/fr.json b/translations/fr.json index 18047642c..df6a7e85a 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -173,5 +173,9 @@ "Donations link": "Lien vers les dons", "Donate": "Faire un don", "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" } diff --git a/translations/ga.json b/translations/ga.json index bae1a501b..137dc1418 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -173,5 +173,9 @@ "Donations link": "Nasc síntiús", "Donate": "Síntiús", "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" } diff --git a/translations/hi.json b/translations/hi.json index 6338ac095..5e484816f 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -173,5 +173,9 @@ "Donations link": "दान लिंक", "Donate": "दान करना", "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" } diff --git a/translations/it.json b/translations/it.json index df270aab2..a75d0ea35 100644 --- a/translations/it.json +++ b/translations/it.json @@ -173,5 +173,9 @@ "Donations link": "Link alle donazioni", "Donate": "Donare", "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" } diff --git a/translations/ja.json b/translations/ja.json index 3f63f1a7b..990ff9bcf 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -173,5 +173,9 @@ "Donations link": "寄付リンク", "Donate": "寄付する", "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" } diff --git a/translations/oc.json b/translations/oc.json index f26e69114..e040d8cbb 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -169,5 +169,9 @@ "Show profile": "Veire lo perfil", "SHOW MORE": "NE VEIRE MAI", "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" } diff --git a/translations/pt.json b/translations/pt.json index 6427ff2d1..98f2e12cd 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -173,5 +173,9 @@ "Donations link": "Link de doações", "Donate": "Doar", "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" } diff --git a/translations/ru.json b/translations/ru.json index fb067ab73..5fff6893b 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -173,5 +173,9 @@ "Donations link": "Ссылка на пожертвования", "Donate": "жертвовать", "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" } diff --git a/translations/zh.json b/translations/zh.json index 3586ae5bd..736db55e1 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -173,5 +173,9 @@ "Donations link": "捐款连结", "Donate": "捐", "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" } diff --git a/webinterface.py b/webinterface.py index 76609a0c8..b78b710a1 100644 --- a/webinterface.py +++ b/webinterface.py @@ -585,9 +585,25 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int) with open(cssFilename, 'r') as cssFile: editProfileCSS = cssFile.read() + instanceStr='' moderatorsStr='' adminNickname=getConfigParam(baseDir,'admin') if path.startswith('/users/'+adminNickname+'/'): + instanceDescription=getConfigParam(baseDir,'instanceDescription') + instanceDescriptionShort=getConfigParam(baseDir,'instanceDescriptionShort') + instanceTitle=getConfigParam(baseDir,'instanceTitle') + instanceStr='