Skip to content
Snippets Groups Projects
widgets-display-breadcrumb.js 1.3 KiB
Newer Older
import("./utils.js").then((utils) => {
    import(/* @vite-ignore */utils.coreVersion()).then((core) => {

        core.Sib.register({
            name: "customtzcld-display-breadcrum-my-territory",
            use: [core.StoreMixin],
      
            empty() {
              //console.debug();
              this.element.innerHTML = "";
            },
      
            async populate() {
              this.element.innerHTML = `
              <div class="loader">
                <div></div>
                <div></div>
                <div></div>
                <div></div>
              </div>`;
              let tzcldprofile = {
                community: await this.resource
              };

              if("label" in this.element.attributes) {
                for(let ignore of this.element.attributes['label'].value.split(',')) {
                  tzcldprofile[ignore.trim()] = null;
                }
              }
              let render = `<solid-link next="tzcld" link-text="">Mes territoires</solid-link>
              >
              <solid-link data-src="${await tzcldprofile.community['@id']}" next="${utils.TZCLD_URLS.my_territory_infos}" link-text="">${await tzcldprofile.community.name}</solid-link>`;
             
              this.element.innerHTML = render;
            },
        });
    });
});