Send request to get all account data

This commit is contained in:
Pierre
2018-05-13 16:52:19 +02:00
parent e9b6df8536
commit f447f30c6c
8 changed files with 312 additions and 0 deletions

View File

@ -14,10 +14,71 @@ ComunicWeb.pages.settings.sections.privacy = {
*/
open: function(args, target){
//Export data box
this.showExportDataBox(target);
//Delete account box
this.showDeleteAccountBox(target);
},
/**
* Show export personnal data box
*
* @param {HTMLElement} target The target for the box
*/
showExportDataBox: function(target){
//Create a box
var box = createElem2({
appendTo: target,
type: "div",
class: "box box-primary box-export-account-data-settings"
});
//Add box header
var boxHead = createElem2({
appendTo: box,
type: "div",
class: "box-header",
});
var boxTitle = createElem2({
appendTo: boxHead,
type: "h3",
class: "box-title",
innerHTML: "Export account data"
});
//Create box body
var boxBody = createElem2({
appendTo: box,
type: "div",
class: "box-body"
});
//Add a notice
createElem2({
appendTo: boxBody,
type: "p",
innerHTML: "You can export all the data of your account from here."
});
//Add delete account button
var exportAccountDataBtn = createElem2({
appendTo: boxBody,
type: "div",
class: "btn btn-primary",
innerHTML: "Export account data"
});
exportAccountDataBtn.addEventListener("click", function(e){
//Request account deletion
ComunicWeb.components.settings.helper.requestAccountDataExport();
});
},
/**
* Display delete account box