Newer
Older
import("./utils.js").then((utils) => {
import(/* @vite-ignore */utils.coreVersion()).then((core) => {
core.Sib.register({
name: "customtzcld-display-user-regions",
use: [core.StoreMixin],
empty() {
this.element.innerHTML = "";
},
async populate() {
this.element.innerHTML = `
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`;
let tzcldprofile = {
regions: await this.resource["ldp:contains"]
};
if("label" in this.element.attributes) {
for(let ignore of this.element.attributes['label'].value.split(',')) {
tzcldprofile[ignore.trim()] = null;
}
}
let render = ``;
if (tzcldprofile.regions && tzcldprofile.regions.length > 0) {
for(let region of tzcldprofile.regions) {
render += `<div class="region segment tag color-fourth">${await region.name}</div>`;
}
this.element.innerHTML = render;
},
});
core.Sib.register({
name: "customtzcld-display-user-profile-phones",
use: [core.StoreMixin],
empty() {
this.element.innerHTML = "";
},
async populate() {
this.element.innerHTML = `
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`;
let tzcldprofile = {
phones: await this.resource["ldp:contains"]
};
if("label" in this.element.attributes) {
for(let ignore of this.element.attributes['label'].value.split(',')) {
tzcldprofile[ignore.trim()] = null;
}
}
let render = ``;
for(let phone of tzcldprofile.phones) {
let phoneType = '' ;
if (await phone.phone_type != null) {
phoneType = await phone.phone_type;
}
if (await phone.phone != null) {
render += `<div class="phone margin-bottom-xxsmall">${await phone.phone} ${await phoneType}</div>`;
}
}
this.element.innerHTML = render;
},
});
core.Sib.register({
name: "customtzcld-display-user-profile-emails",
use: [core.StoreMixin],
empty() {
this.element.innerHTML = "";
},
async populate() {
this.element.innerHTML = `
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`;
let tzcldprofile = {
emails: await this.resource["ldp:contains"]
};
if("label" in this.element.attributes) {
for(let ignore of this.element.attributes['label'].value.split(',')) {
tzcldprofile[ignore.trim()] = null;
}
}
let render = ``;
for(let email of tzcldprofile.emails) {
let emailType = '' ;
if (await email.email_type != null) {
emailType = await email.email_type;
}
if (await email.email != null) {
render += `<div class="email margin-bottom-xxsmall"><a class="link" href="mailto:${await email.email}">${await email.email}</a> ${emailType}</div>`;
}
}
this.element.innerHTML = render;
},
});
core.Sib.register({
name: "customtzcld-display-user-profile-jobs",
use: [core.StoreMixin],
empty() {
this.element.innerHTML = "";
},
async populate() {
this.element.innerHTML = `
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`;
let tzcldprofile = {
jobs: await this.resource["ldp:contains"]
};
if("label" in this.element.attributes) {
for(let ignore of this.element.attributes['label'].value.split(',')) {
tzcldprofile[ignore.trim()] = null;
}
}
let render = `<div class="segment full margin-top-small margin-bottom-small">`;
for(let job of tzcldprofile.jobs) {
render += `<div class="full padding-top-large padding-bottom-medium">`;
if(await job.organisation !="") {
if(await job.link !="") {
render += `<div class="segment icontz-mdi_account-outline icon-third text-xxlarge text-top padding-right-xsmall"></div>
<div class="segment width-90">`;
render += `<h3 class="position text-medium padding-bottom-large whitespace-normal margin-none">${await job.position} à <a class="link text-top" target="_blank" href="${await job.link}">${await job.organisation}</a></h3>`;
render += `<h3 class="position text-medium padding-bottom-large whitespace-normal margin-none">${await job.position} à ${await job.organisation}</h3>`;
render += `<h3 class="position text-medium padding-bottom-large whitespace-normal margin-none">${await job.position}</h3>`;
render += `<div class="full address padding-bottom-small whitespace-normal">
<div class="segment icontz-mdi_map-marker icon-third text-xxlarge text-top padding-right-xsmall"></div>
<div class="segment width-90">${await job.address} <br/> ${await job.postal_code} ${await job.city}</div>
</div>`;
if ((await job.mobile_phone != '' && await job.mobile_phone_public == true ) || (await job.phone != '' && await job.phone_public == true)) {
render += `<div class="full phone padding-bottom-small ">
<div class="segment icontz-ic_call icon-third text-xxlarge text-top padding-right-xsmall"></div>
<div class="segment width-90">`;
if (await job.mobile_phone != '' && await job.mobile_phone_public == true) {
render += `${await job.mobile_phone}`;
if ((await job.mobile_phone != '') && (await job.phone != '') && await job.mobile_phone_public == true && await job.phone_public == true) {
if (await job.phone != '' && await job.phone_public == true) {
render += `${await job.phone}`;
if ((await job.mobile_phone != '' && await job.mobile_phone_public == true ) || (await job.phone != '' && await job.phone_public == true)) {
if (await job.email != '' && await job.email_public == true) {
render += `<div class="full email padding-bottom-small">
<div class="segment icontz-mdi_email-outline icon-third text-xxlarge text-top padding-right-xsmall"></div>
<div class="segment width-90">
<a class="link text-top" href="mailto:${await job.email}">${await job.email}</a></div>
</div>`;
}
render += `</div>`;
this.element.innerHTML = render;
},
});
core.Sib.register({
name: "customtzcld-display-user-profile-first-jobs",
use: [core.StoreMixin],
empty() {
this.element.innerHTML = "";
},
async populate() {
this.element.innerHTML = `
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`;
let tzcldprofile = {
jobs: await this.resource["ldp:contains"]
};
if("label" in this.element.attributes) {
for(let ignore of this.element.attributes['label'].value.split(',')) {
tzcldprofile[ignore.trim()] = null;
}
}
let render = `<div class="segment full margin-top-small margin-bottom-small user-first-job whitespace-normal">`;
for(let job of tzcldprofile.jobs) {
if(await job.organisation !="") {
if(await job.link !="") {
render += `<h4 class="position text-medium padding-bottom-large">${await job.position} à <a class="link text-top" target="_blank" href="${await job.link}">${await job.organisation}</a></h4>`;
} else {
render += `<h4 class="position text-medium padding-bottom-large">${await job.position} à ${await job.organisation}</h4>`;
}
} else {
render += `<h4 class="position text-medium padding-bottom-large">${await job.position}</h4>`;
}
if(await job.city !="") {
render += `<div class="address padding-bottom-small"> à ${await job.city} (${await job.postal_code})</div>`;
}
break ;
}
render += `</div>`;
this.element.innerHTML = render;
},
});
core.Sib.register({
name: "customtzcld-display-user-profile-first-job-short",
use: [core.StoreMixin],
empty() {
this.element.innerHTML = "";
},
async populate() {
this.element.innerHTML = `
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`;
let tzcldprofile = {
jobs: await this.resource["ldp:contains"]
};
if("label" in this.element.attributes) {
for(let ignore of this.element.attributes['label'].value.split(',')) {
tzcldprofile[ignore.trim()] = null;
}
}
let render = `<div class="segment full margin-top-xxsmall margin-bottom-xxsmall user-first-job whitespace-normal">`;
for(let job of tzcldprofile.jobs) {
if ((await job.organisation !="") && (await job.organisation != undefined)) {
if(await job.link !="") {
render += `<h4 class="position text-medium padding-bottom-large">${await job.position} - <a class="link text-top" target="_blank" href="${await job.link}">${await job.organisation}</a></h4>`;
} else {
render += `<h4 class="position text-medium padding-bottom-large">${await job.position} - ${await job.organisation}</h4>`;
}
} else {
render += `<h4 class="position text-medium padding-bottom-large">${await job.position}</h4>`;
}
break ;
}
render += `</div>`;
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
this.element.innerHTML = render;
},
});
core.Sib.register({
name: "customtzcld-display-user-profile-first-job-referent-short",
use: [core.StoreMixin],
empty() {
//console.debug();
this.element.innerHTML = "ggggg";
},
async populate() {
this.element.innerHTML = `
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`;
let tzcldprofile = {
jobs: await this.resource["ldp:contains"]
};
if("label" in this.element.attributes) {
for(let ignore of this.element.attributes['label'].value.split(',')) {
tzcldprofile[ignore.trim()] = null;
}
}
let render = `<div class="segment full margin-top-xxsmall margin-bottom-xxsmall user-first-job whitespace-normal">`;
for(let job of tzcldprofile.jobs) {
if ((await job.mobile_phone != '' && await job.mobile_phone_public == true ) || (await job.phone != '' && await job.phone_public == true)) {
render += `<div class="full phone padding-bottom-small ">
<div class="segment icontz-ic_call icon-third text-xxlarge text-top padding-right-xsmall"></div>
<div class="segment width-90">`;
}
if (await job.mobile_phone != '' && await job.mobile_phone_public == true) {
render += `${await job.mobile_phone}`;
}
if ((await job.mobile_phone != '') && (await job.phone != '') && await job.mobile_phone_public == true && await job.phone_public == true) {
render += ` - `;
}
if (await job.phone != '' && await job.phone_public == true) {
render += `${await job.phone}`;
}
if ((await job.mobile_phone != '' && await job.mobile_phone_public == true ) || (await job.phone != '' && await job.phone_public == true)) {
render += `</div>
</div>`;
}
if (await job.email != '' && await job.email_public == true) {
render += `<div class="full email padding-bottom-small">
<div class="segment icontz-mdi_email-outline icon-third text-xxlarge text-top padding-right-xsmall"></div>
<div class="segment width-90">
<a class="link text-top" href="mailto:${await job.email}">${await job.email}</a></div>
</div>`;
}
break ;
}
render += `</div>`;
this.element.innerHTML = render;
},
});
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
core.Sib.register({
name: "customtzcld-display-user-profile-first-job-circle",
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 userEntity = {
user: await this.resource.tzcld_profile
}
let tzcldUserProfile = {
profile: await userEntity.user.jobs,
regions: await userEntity.user.regions,
};
if("label" in this.element.attributes) {
for(let ignore of this.element.attributes['label'].value.split(',')) {
tzcldprofile[ignore.trim()] = null;
}
}
let render = `<div class="segment full margin-bottom-xxsmall user-first-job-circle whitespace-normal">`;
for(let job of tzcldUserProfile.profile["ldp:contains"]) {
if(await job.organisation !="") {
if(await job.link !="") {
render += `<h4 class="position text-small text-normal padding-bottom-xxsmall">${await job.position} - <a class="link" target="_blank" href="${await job.link}">${await job.organisation}</a></h4>`;
} else {
render += `<h4 class="position text-small text-normal padding-bottom-xxsmall">${await job.position} - ${await job.organisation}</h4>`;
}
} else {
render += `<h4 class="position text-small text-normal padding-bottom-xxsmall">${await job.position}</h4>`;
}
break ;
}
for(let region of await tzcldUserProfile.regions["ldp:contains"]) {
render += `<div class="region segment tag color-fourth">${await region.name}</div>`;
}
render += `</div>`;
this.element.innerHTML = render;
},
});