maj site admin

This commit is contained in:
2025-10-01 15:10:50 +02:00
parent 46cf2e83e2
commit b804230b1b
17 changed files with 312 additions and 18 deletions

7
.gitignore vendored
View File

@@ -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
tribes
# Ignore dynamique file
wwws/*/src/static/css/output.css

View File

@@ -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."
}
}
}

0
wco/apxform/apxform.js Normal file
View File

61
wco/apxform/example.json Normal file
View 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 lutilisateur 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
}
}
}

View File

View 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`;
}

View 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>

View File

View File

View File

31
wco/itm/apxprofil.json Normal file
View 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"]
}

View File

@@ -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

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="fr" data-theme="apxtridark" class="h-full bg-base-200 text-neutral-content ">
<html lang="fr" data-theme="apxtridark">
<head>
<meta charset="utf-8" />
<title>Mon profil</title>
@@ -34,9 +34,8 @@
xuuid:0
},
pagename: "myprofil",
pageauth: "apxid",
wcoobserver:true,
allowedprofils:["anonymous"],
allowedprofils:["pagans"],
version:0
};
</script>
@@ -48,19 +47,16 @@
<script src="/apxtrilib/checkjson.js"></script>
<script src="/api/apxtri/wwws/getwco/apx.js?wcotribe=apxtri&tribe=apxtri&xapp=admin&pagename=apxid&code=enjoy"></script>
<script src="/api/apxtri/wwws/getwco/simplemobnav.js?wcotribe=apxtri&tribe=apxtri&xapp=admin&pagename=apxid&code=enjoy&tagid=mydata"></script>
<script src="/api/apxtri/wwws/getwco/simplemobnav.js?wcotribe=apxtri&tribe=apxtri&xapp=admin&pagename=myprofil&code=enjoy&tagid=mydata"></script>
<script src="/api/apxtri/wwws/getwco/apxprofil.js?wcotribe=apxtri&tribe=apxtri&xapp=admin&pagename=myprofil&code=enjoy&tagid=mychoice"></script>
</head>
<body class="h-full">
<div class="flex items-center justify-center min-h-screen px-4">
<body class="bg-base-100 flex items-center justify-center min-h-screen">
<div class="flex items-center justify-center min-h-screen px-4">
<div
id="mydata"
wco-name="simplemobnav"
class="bg-base-100 min-h-screen w-full p-4 text-center">
class="w-full h-screen sm:w-[600px] bg-base-100 rounded-none sm:rounded-2xl shadow-xl flex flex-col overflow-hidden">
</div>
<!--div wco-name="chatroom" class="hidden min-h-full flex-col justify-center px-6 py-12 lg:px-8">
</div-->
</div>
</body>
</html>

View File

@@ -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",

View File

@@ -0,0 +1,3 @@
{
}

View File

@@ -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": []
}
]
}