maj site admin
This commit is contained in:
0
wco/apxform/apxform.js
Normal file
0
wco/apxform/apxform.js
Normal file
61
wco/apxform/example.json
Normal file
61
wco/apxform/example.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"optionid": "formpagans",
|
||||
"title": "Collecte des données publiques de Pagans",
|
||||
"description": "Profil disponible dans apxtri",
|
||||
"comment": "",
|
||||
"lastupdatedata": "",
|
||||
"lst_idx": [
|
||||
"alias",
|
||||
"email",
|
||||
"profil",
|
||||
"biography",
|
||||
"trusted"
|
||||
],
|
||||
"itms": {
|
||||
"alias": {
|
||||
"title": "Alias",
|
||||
"description": "Identifiant public de l’utilisateur dans le réseau apxtri",
|
||||
"type": "string",
|
||||
"widget": "input",
|
||||
"placeholder": "Entrez votre alias",
|
||||
"required": true
|
||||
},
|
||||
"email": {
|
||||
"title": "Email de récupération",
|
||||
"description": "Permet de récupérer vos clés en cas de perte",
|
||||
"type": "string",
|
||||
"widget": "input",
|
||||
"placeholder": "Entrez votre email",
|
||||
"required": false
|
||||
},
|
||||
"profil": {
|
||||
"title": "Profil",
|
||||
"description": "Sélectionnez votre rôle dans le réseau",
|
||||
"type": "string",
|
||||
"widget": "select",
|
||||
"options": [
|
||||
{ "value": "anonymous", "label": "Utilisateur non identifié" },
|
||||
{ "value": "pagan", "label": "Utilisateur avec identité apxtri" },
|
||||
{ "value": "mayor", "label": "Administrateur d'une cité" },
|
||||
{ "value": "druid", "label": "Administrateur d'une tribu" },
|
||||
{ "value": "person", "label": "Membre d'une tribu" }
|
||||
],
|
||||
"required": true
|
||||
},
|
||||
"biography": {
|
||||
"title": "Biographie",
|
||||
"description": "Quelques mots sur vous",
|
||||
"type": "string",
|
||||
"widget": "textarea",
|
||||
"placeholder": "Présentez-vous…",
|
||||
"required": false
|
||||
},
|
||||
"trusted": {
|
||||
"title": "Domaine de confiance",
|
||||
"description": "Autoriser ce domaine à stocker vos clés privées",
|
||||
"type": "boolean",
|
||||
"widget": "checkbox",
|
||||
"required": false
|
||||
}
|
||||
}
|
||||
}
|
0
wco/apxform/form.mustache
Normal file
0
wco/apxform/form.mustache
Normal file
53
wco/apxprofil/apxprofil.js
Normal file
53
wco/apxprofil/apxprofil.js
Normal file
@@ -0,0 +1,53 @@
|
||||
var apx = apx || {};
|
||||
apx.apxprofil = {};
|
||||
apx.apxprofil.loadwco = async (id, ctx) => {
|
||||
console.log(
|
||||
`Load wconame:apxauth apx.apxauth.loadwco with id:${id} and ctx: ${JSON.stringify(
|
||||
ctx
|
||||
)}`
|
||||
);
|
||||
// Check that in localdb tpl exist if not means it is not authenticated
|
||||
if (!apx.data.tpl[`apxauthscreen${ctx.link}`]) ctx.link="signin";
|
||||
const tpldataname = `${apx.data.pagename}_${id}_apxprofil`;
|
||||
const destid = document.getElementById(id);
|
||||
const data = apx.apxprofil.getdata(id, ctx);
|
||||
if (destid.innerHTML.trim() === "") {
|
||||
destid.innerHTML = Mustache.render(apx.data.tpl.apxprofilmain, data);
|
||||
}
|
||||
destid.querySelector(`.screenaction`).innerHTML = Mustache.render(
|
||||
apx.data.tpl[`apxprofilscreen${ctx.link}`],
|
||||
data
|
||||
);
|
||||
apxauthid.querySelector(`.msginfo`).innerHTML = "";
|
||||
};
|
||||
apx.apxprofil.getdata = (id, ctx) => {
|
||||
const tpldataname = `${apx.data.pagename}_${id}_apxauth`;
|
||||
const data = JSON.parse(JSON.stringify(apx.data.tpldata[tpldataname]));
|
||||
data.id = id;
|
||||
data.xalias = apx.data.headers.xalias;
|
||||
data.xtribe = apx.data.headers.xtribe;
|
||||
|
||||
data.emailsupport = apx.data?.appdata?.emailsupport
|
||||
? apx.data.appdata.emailsupport
|
||||
: "";
|
||||
console.log("data:",data)
|
||||
switch (ctx.link) {
|
||||
case "alias":
|
||||
break;
|
||||
case "unique":
|
||||
break;
|
||||
case "tribes":
|
||||
break;
|
||||
case "towns":
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
console.log("data for tpl:", data);
|
||||
return data;
|
||||
};
|
||||
|
||||
apx.apxprofil.gohome=()=>{
|
||||
window.location.href=`apxid_${apx.data.headers.xlang}.html`;
|
||||
|
||||
}
|
7
wco/apxprofil/main_fr.mustache
Normal file
7
wco/apxprofil/main_fr.mustache
Normal file
@@ -0,0 +1,7 @@
|
||||
<!-- screen action-->
|
||||
<div class="screenaction mt-5 px-7 w-full">
|
||||
</div>
|
||||
<!-- feedback action-->
|
||||
<div class="my-5 w-full">
|
||||
<p class="msginfo text-center text-info"></p>
|
||||
</div>
|
0
wco/apxprofil/screenmyalias_fr.mustache
Normal file
0
wco/apxprofil/screenmyalias_fr.mustache
Normal file
0
wco/apxprofil/screenmypublicdata_fr.mustache
Normal file
0
wco/apxprofil/screenmypublicdata_fr.mustache
Normal file
0
wco/apxprofil/screenmytowns_fr.mustache
Normal file
0
wco/apxprofil/screenmytowns_fr.mustache
Normal file
0
wco/apxprofil/screenmytribes_fr.mustache
Normal file
0
wco/apxprofil/screenmytribes_fr.mustache
Normal file
31
wco/itm/apxprofil.json
Normal file
31
wco/itm/apxprofil.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"wconame": "apxprofil",
|
||||
"owner": "philc",
|
||||
"price": 1,
|
||||
"aliascode": [],
|
||||
"commentaliascode": "if paid wco then [tribename_uniquecode,...]",
|
||||
"codehash": "123",
|
||||
"thumbnail": "",
|
||||
"title": "Manage a pagans profil",
|
||||
"description": "Allow for an alias to manage its public data, and some private data like towns i am following, tribes i joined, my public data link to this alias, eventually my other alias and their privatekey",
|
||||
"lang": ["fr"],
|
||||
"tpl": {
|
||||
"apxprofilmain":"apxtri/objects/wco/apxprofil/main",
|
||||
"apxprofilscreenmyalias":"apxtri/objects/wco/apxprofil/screenmyalias",
|
||||
"apxprofilscreenpublicdata":"apxtri/objects/wco/apxprofil/screenpublicdata",
|
||||
"apxprofilscreenmytowns":"apxtri/objects/wco/apxprofil/screenmytowns",
|
||||
"apxprofilscreenmytribes":"apxtri/objects/wco/apxprofil/screenmytribes"
|
||||
},
|
||||
"tpldatamodel": { "apxauth": "apxtri/objects/wco/apxprofil/exampleapxprofil" },
|
||||
"options": {
|
||||
"profil": "{{tribeId}}/objects/options/profil"
|
||||
},
|
||||
"ref": {
|
||||
"Odmdb": "apxtri/models/tplstrings/Odmdb",
|
||||
"Pagans": "apxtri/models/tplstrings/Pagans",
|
||||
"Persons": "apxtri/models/tplstrings/Persons",
|
||||
"Tribes":"apxtri/models/tplstrings/Tribes",
|
||||
"Towns":"apxtri/models/tplstrings/Towns"
|
||||
},
|
||||
"schema": ["apxtri/objects/pagans", "{{tribe}}/objects/persons","{{tribe}}/objects/tribes","{{tribe}}/objects/towns"]
|
||||
}
|
@@ -5,9 +5,6 @@ apx.simplemobnav.loadwco = (id, ctx) => {
|
||||
const tpldataname = `${apx.data.pagename}_${id}_simplemobnav`;
|
||||
const simplemobnavid = document.getElementById(id)
|
||||
console.log("load simplemobnav with tpldataname:", tpldataname, " id:", id, " ctx:", ctx);
|
||||
// check if authenticate if yes then show myworld instead of signin
|
||||
//console.log("ggggggggggggg",apx.data.headers.xalias)
|
||||
//if (apx.data.headers.xalias!="anonymous") ctx.link="myworld";
|
||||
let initmenu;
|
||||
if (simplemobnavid.innerHTML.trim() === "") {
|
||||
// Get 1st menu matching the first profil in profilmenu
|
||||
|
Reference in New Issue
Block a user