/*eslint no-undef:0*/ /*eslint-env browser*/ "use strict"; var towns = towns || {}; towns.loadtpldata = (fortpl) => { // adapte tpldata to template tpl if (fortpl == "owner") { const dataowner = apx.data.tpldata.setup; dataowner.alias = apx.data.headers.xalias; dataowner.auth = dataowner.alias != "anonymous"; dataowner.devtown = dataowner.townId == "devfarm"; if (dataowner.mayorId) dataowner.owner = dataowner.mayorId == dataowner.alias; console.log("Data return to template", dataowner); return dataowner; } if (fortpl == "tribes") { const data= { idcomponent: "tribesmanager", objectname:"tribes", itm: [ { tribeId: "tribe1", druidId: "philc" }, { tribeId: "tribe2", druidId: "toto" }, ] }; data.tplform=`