From 079e3b7f1e5525c4e231b0478fa0e638af211b1c Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 16 Apr 2021 15:20:44 +0200 Subject: [PATCH] Can update new settings --- assets/js/pages/settings/sections/general.js | 24 ++++++++++++++++++-- assets/js/typings/ServerConfig.d.ts | 1 + 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/assets/js/pages/settings/sections/general.js b/assets/js/pages/settings/sections/general.js index f878c27a..5aa21b52 100644 --- a/assets/js/pages/settings/sections/general.js +++ b/assets/js/pages/settings/sections/general.js @@ -199,15 +199,33 @@ ComunicWeb.pages.settings.sections.general = { checked: infos.public_friends_list }); + //Public email address + var publicEmailAddress = createFormGroup({ + target: target, + type: "checkbox", + label: tr("Make your email address public"), + checked: infos.public_email + }); + //Personnal website var personnalWebsite = createFormGroup({ target: target, - label: tr("Personnal website (optionnal)"), + label: tr("Personnal website (optional)"), type: "text", placeholder: "https://...", value: infos.personnal_website != "null" ? infos.personnal_website : "" }); + //Location + var location = createFormGroup({ + target: target, + label: tr("Location (optional)"), + type: "text", + placeholder: "Feurs", + value: infos.location != null ? infos.location : "", + maxLength: ServerConfig.conf.account_info_policy.max_location_length, + }); + //Public notes var publicNotes = createFormGroup({ target: target, @@ -286,16 +304,18 @@ ComunicWeb.pages.settings.sections.general = { allowComments: allowComments.checked, allowPostsFromFriends: allowPostsFromFriends.checked, publicFriendsList: publicFriendsList.checked, + email_public: publicEmailAddress.checked, personnalWebsite: personnalWebsite.value, virtualDirectory: virtualDirectory.value, publicNote: publicNotes.value, + location: location.value, }; //Lock send button sendButton.style.visibility = "hidden"; //Perform the request over the API - ComunicWeb.components.settings.interface.setGeneral(settings, function(result){ + SettingsInterface.setGeneral(settings, function(result){ //Unlock send button sendButton.style.visibility = "visible"; diff --git a/assets/js/typings/ServerConfig.d.ts b/assets/js/typings/ServerConfig.d.ts index bac0a1b7..d2782174 100644 --- a/assets/js/typings/ServerConfig.d.ts +++ b/assets/js/typings/ServerConfig.d.ts @@ -38,6 +38,7 @@ declare interface AccountInformationPolicy { max_first_name_length: number, min_last_name_length: number, max_last_name_length: number, + max_location_length: number, } declare interface StaticServerConfig {