/*eslint no-undef:0*/
/*eslint-env browser*/

"use strict";
var tribes = tribes || {};

tribes.loadtpldata = () => {
  // adapte tpldata to template tpl
  const datahost = apx.data.tpldata.setup;
  datahost.offers=[{offerid:"Z",title:" Offre gratuite Max space 1Mo public"},{offerid:"A",title:" Max space 5Mo public"},{offerid:"B",title:" Max space 5Mo private for less than 100 Persons"},{offerid:"C",title:" Max space 500 Mo private for less than 100 Persons"},{offerid:"D",title:" Max space 2 Go private for less than 1000 Persons"}],
  datahost.alias=apx.data.headers.xalias;
  datahost.auth = datahost.alias=="anonymous";
  console.log('Data return to template',datahost)
  return datahost;
};
tribes.addspaceweb = ( offer,domain, appname,msg) => {
    // Request to a druid to host  space web accessible from a domain to share tribes data /persons / ...
    alert('Under construction to send notification to druid to get an access')
};
