Can update new settings

This commit is contained in:
Pierre HUBERT 2021-04-16 15:20:44 +02:00
parent e710450983
commit 079e3b7f1e
2 changed files with 23 additions and 2 deletions

View File

@ -199,15 +199,33 @@ ComunicWeb.pages.settings.sections.general = {
checked: infos.public_friends_list 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 //Personnal website
var personnalWebsite = createFormGroup({ var personnalWebsite = createFormGroup({
target: target, target: target,
label: tr("Personnal website (optionnal)"), label: tr("Personnal website (optional)"),
type: "text", type: "text",
placeholder: "https://...", placeholder: "https://...",
value: infos.personnal_website != "null" ? infos.personnal_website : "" 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 //Public notes
var publicNotes = createFormGroup({ var publicNotes = createFormGroup({
target: target, target: target,
@ -286,16 +304,18 @@ ComunicWeb.pages.settings.sections.general = {
allowComments: allowComments.checked, allowComments: allowComments.checked,
allowPostsFromFriends: allowPostsFromFriends.checked, allowPostsFromFriends: allowPostsFromFriends.checked,
publicFriendsList: publicFriendsList.checked, publicFriendsList: publicFriendsList.checked,
email_public: publicEmailAddress.checked,
personnalWebsite: personnalWebsite.value, personnalWebsite: personnalWebsite.value,
virtualDirectory: virtualDirectory.value, virtualDirectory: virtualDirectory.value,
publicNote: publicNotes.value, publicNote: publicNotes.value,
location: location.value,
}; };
//Lock send button //Lock send button
sendButton.style.visibility = "hidden"; sendButton.style.visibility = "hidden";
//Perform the request over the API //Perform the request over the API
ComunicWeb.components.settings.interface.setGeneral(settings, function(result){ SettingsInterface.setGeneral(settings, function(result){
//Unlock send button //Unlock send button
sendButton.style.visibility = "visible"; sendButton.style.visibility = "visible";

View File

@ -38,6 +38,7 @@ declare interface AccountInformationPolicy {
max_first_name_length: number, max_first_name_length: number,
min_last_name_length: number, min_last_name_length: number,
max_last_name_length: number, max_last_name_length: number,
max_location_length: number,
} }
declare interface StaticServerConfig { declare interface StaticServerConfig {