apxtrib/adminapi/www/adminapx/static/js/apxtowns.js
2023-05-31 15:19:21 +02:00

23 lines
581 B
JavaScript

/*eslint no-undef:0*/
/*eslint-env browser*/
"use strict";
var towns = towns || {};
towns.loadtpldata = () => {
// adapte tpldata to template tpl
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;
};
towns.owntown = () => {
// only the owner can give ownership to someone else
};