diff --git a/.gitignore b/.gitignore index 0ce657b..a5849b8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,7 @@ wwws/*/dist/** !wwws/*/src/ !wwws/*/src/** -!wwws/itm/ -!wwws/itm/** +wwws/itm/* wwws/cdn/lib/* !wwws/cdn/lib/libsource.json devices @@ -13,4 +12,6 @@ nations pagans persons towns -tribes \ No newline at end of file +tribes +# Ignore dynamique file +wwws/*/src/static/css/output.css diff --git a/options/itm/formpagans_fr.json b/options/itm/formpagans_fr.json new file mode 100644 index 0000000..fe8bc0e --- /dev/null +++ b/options/itm/formpagans_fr.json @@ -0,0 +1,36 @@ +{ + "optionid":"profil_en", + "title": "Profil", + "description": "Profil available in apxtri", + "commment": "", + "lastupdatedata": "", + "lst_idx": [ + "anonymous", + "pagan", + "mayor", + "druid", + "person" + ], + "itms": { + "anonymous": { + "title": "Unidentified user", + "description": "Unknown to the apxtri network" + }, + "pagan": { + "title": "User with an apxtri identity", + "description": "This profile can digitally sign on the apxtri blockchain" + }, + "mayor": { + "title": "Administrator of a city", + "description": "He manages the rules specific to a tribe grouping, he finances this city and can define its billing terms for welcoming tribes" + }, + "druid": { + "title": "Administrator of a tribe", + "description": "He has a private space in a city, to apply and enforce the rules of the tribe." + }, + "person": { + "title": "A member of a tribe", + "description": "A person has an account in a tribe with their alias, it allows them to exchange within a tribe according to the rules set by the druid." + } + } +} diff --git a/wco/apxform/apxform.js b/wco/apxform/apxform.js new file mode 100644 index 0000000..e69de29 diff --git a/wco/apxform/example.json b/wco/apxform/example.json new file mode 100644 index 0000000..39d4820 --- /dev/null +++ b/wco/apxform/example.json @@ -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 + } + } +} \ No newline at end of file diff --git a/wco/apxform/form.mustache b/wco/apxform/form.mustache new file mode 100644 index 0000000..e69de29 diff --git a/wco/apxprofil/apxprofil.js b/wco/apxprofil/apxprofil.js new file mode 100644 index 0000000..6c68ccc --- /dev/null +++ b/wco/apxprofil/apxprofil.js @@ -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`; + +} \ No newline at end of file diff --git a/wco/apxprofil/main_fr.mustache b/wco/apxprofil/main_fr.mustache new file mode 100644 index 0000000..337f9f7 --- /dev/null +++ b/wco/apxprofil/main_fr.mustache @@ -0,0 +1,7 @@ + +
+
+ +
+

+
\ No newline at end of file diff --git a/wco/apxprofil/screenmyalias_fr.mustache b/wco/apxprofil/screenmyalias_fr.mustache new file mode 100644 index 0000000..e69de29 diff --git a/wco/apxprofil/screenmypublicdata_fr.mustache b/wco/apxprofil/screenmypublicdata_fr.mustache new file mode 100644 index 0000000..e69de29 diff --git a/wco/apxprofil/screenmytowns_fr.mustache b/wco/apxprofil/screenmytowns_fr.mustache new file mode 100644 index 0000000..e69de29 diff --git a/wco/apxprofil/screenmytribes_fr.mustache b/wco/apxprofil/screenmytribes_fr.mustache new file mode 100644 index 0000000..e69de29 diff --git a/wco/itm/apxprofil.json b/wco/itm/apxprofil.json new file mode 100644 index 0000000..52b9339 --- /dev/null +++ b/wco/itm/apxprofil.json @@ -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"] +} diff --git a/wco/simplemobnav/simplemobnav.js b/wco/simplemobnav/simplemobnav.js index 2b1c3bf..b3ac952 100644 --- a/wco/simplemobnav/simplemobnav.js +++ b/wco/simplemobnav/simplemobnav.js @@ -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 diff --git a/wwws/admin/src/myprofil_fr.html b/wwws/admin/src/myprofil_fr.html index 31e063c..795833b 100644 --- a/wwws/admin/src/myprofil_fr.html +++ b/wwws/admin/src/myprofil_fr.html @@ -1,5 +1,5 @@ - + Mon profil @@ -34,9 +34,8 @@ xuuid:0 }, pagename: "myprofil", - pageauth: "apxid", wcoobserver:true, - allowedprofils:["anonymous"], + allowedprofils:["pagans"], version:0 }; @@ -48,19 +47,16 @@ - - + + - -
- + +
+ class="w-full h-screen sm:w-[600px] bg-base-100 rounded-none sm:rounded-2xl shadow-xl flex flex-col overflow-hidden">
-
diff --git a/wwws/admin/src/tpldata/apxid_mydata_simplemobnav_fr.json b/wwws/admin/src/tpldata/ASUP_apxid_mydata_simplemobnav_fr.json similarity index 95% rename from wwws/admin/src/tpldata/apxid_mydata_simplemobnav_fr.json rename to wwws/admin/src/tpldata/ASUP_apxid_mydata_simplemobnav_fr.json index eeaa768..94008dc 100644 --- a/wwws/admin/src/tpldata/apxid_mydata_simplemobnav_fr.json +++ b/wwws/admin/src/tpldata/ASUP_apxid_mydata_simplemobnav_fr.json @@ -9,7 +9,7 @@ "textContent": "Never miss an opportunity" }, "textlist": true, - "commentmenutype": "textlist: vertical list of menu with texte, buttonlist: horizontal btn", + "commentmenutype": "textlist:true == vertical list of menu with texte, buttonlist:true == horizontal btn", "profilmenu": [ { "mainprofil": "persons", diff --git a/wwws/admin/src/tpldata/myprofil_mychoice_apxprofil_fr.json b/wwws/admin/src/tpldata/myprofil_mychoice_apxprofil_fr.json new file mode 100644 index 0000000..544b7b4 --- /dev/null +++ b/wwws/admin/src/tpldata/myprofil_mychoice_apxprofil_fr.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/wwws/admin/src/tpldata/myprofil_mydata_simplemobnav_fr.json b/wwws/admin/src/tpldata/myprofil_mydata_simplemobnav_fr.json new file mode 100644 index 0000000..38f7a29 --- /dev/null +++ b/wwws/admin/src/tpldata/myprofil_mydata_simplemobnav_fr.json @@ -0,0 +1,109 @@ +{ + "contentwconame": "apxprofil", + "contentid": "mychoice", + "logobgdark": { + "src": "static/img/logo/logobgdark.png", + "alt": "apxtri" + }, + "logobglight": { + "src": "static/img/logo/logobglight.png", + "alt": "apxtri" + }, + "claim": { + "textContent": "L'Unique et sa Propriété" + }, + "navtpl":"navbuttonh", + "classnavbutton":"btn-primary hover:bg-secondary", + "classnavlist":{"p":"text-sm text-gray-500","a":"text-secondary hover:text-primary"}, + "profilmenu": [ + { + "mainprofil": "major", + "link": "mytowns" + }, + { + "mainprofil": "druid", + "link": "mytribes" + }, + { + "mainprofil": "persons", + "link": "myalias" + }, + { + "mainprofil": "pagans", + "link": "mypublicdata" + } + ], + "links": [ + { + "link": "mytowns", + "d":"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z", + "shortlabel":"Villes", + "label": "Mes villes", + "textlink": "Mes villes suivies", + "allowedprofil":["pagans"], + "action":"navigation", + "next": [ + "mytribes", + "myalias", + "mypublicdata", + "back" + ] + }, + { + "link": "mytribes", + "d":"M13.5 10.5V6.75a4.5 4.5 0 1 1 9 0v3.75M3.75 21.75h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H3.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z", + "shortlabel": "Tribus", + "label": "Mes tribus", + "textlink": "Mes tribus suivis", + "allowedprofil":["pagans"], + "action":"navigation", + "next": [ + "mytowns", + "myalias", + "mypublicdata", + "back" + ] + }, + { + "link": "myalias", + "d":"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z", + "shortlabel": "Alias", + "label": "Mes alias", + "textlink": "Lien cours avec vos identifiant par alias", + "allowedprofil":["pagans"], + "action":"navigation", + "next": [ + "mytowns", + "mytribes", + "mypublicdata", + "back" + ] + }, + { + "link": "mypublicdata", + "d":"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z", + "shortlabel": "Public data", + "label": " Mes données public", + "textlink": "Info associée à cet alias", + "allowedprofil":["pagans"], + "action":"navigation", + "next": [ + "mytowns", + "mytribes", + "myalias", + "back" + ] + }, + { + "link": "back", + "d":"M9 15 3 9m0 0 6-6M3 9h12a6 6 0 0 1 0 12h-3", + "shortlabel":"Retour", + "label": "Retour au menu ", + "allowedprofil":["anonymous"], + "action":"gohome", + "wconame":"apxprofil", + "textlink": "Retour", + "next": [] + } + ] +} \ No newline at end of file