From 92038bf2cce6a63588615b48bab286ce5a8107ce Mon Sep 17 00:00:00 2001 From: Antoine37 <ant.dupre@gmail.com> Date: Fri, 30 Jun 2023 15:33:05 +0200 Subject: [PATCH] feature: add icons for EBE display --- src/widjets-display-territory-tzcld.js | 37 +++++++++++++++++--------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/src/widjets-display-territory-tzcld.js b/src/widjets-display-territory-tzcld.js index 6f3687f..bf0c5a5 100644 --- a/src/widjets-display-territory-tzcld.js +++ b/src/widjets-display-territory-tzcld.js @@ -86,28 +86,39 @@ import("./utils.js").then((utils) => { tzcldprofile[ignore.trim()] = null; } } - let render = `<div class="segment full">`; + let render = `<div class="segment full margin-bottom-xxlarge">`; for(let job of tzcldprofile.locations) { + let phones = await job.phones ; + let emails = await job.emails ; - render += `<div class="segment half padding-left-xxlarge padding-right-xxlarge margin-top-xxlarge margin-bottom-xxlarge">`; + render += `<div class="segment half padding-left-xxlarge padding-right-xxlarge margin-top-xxlarge margin-bottom-none">`; if(await job.name !="") { render += `<h3 class="position text-medium text-color-secondary text-xlarge margin-top-none">${await job.name}</h3>`; } else { } - render += `<div class="address padding-bottom-small">${await job.address} <br/> ${await job.postal_code} ${await job.city}</div>`; - if ((await job.mobile_phone != '') || (await job.phone != '')) { - render += `<div class="phone-email segment block padding-bottom-small">`; + render += `<div class="full address padding-bottom-small"> + <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 phones.getLdpContains().length > 0) { + render += `<div class="full phone padding-bottom-small"> + <div class="segment icontz-ic_call icon-third text-xxlarge text-top padding-right-xsmall"></div> + <solid-display class="segment width-90" bind-resources="" fields="phones" + widget-phones="customtzcld-display-user-profile-phones" + data-src="${await job}" solid-resource=""></solid-display> + </div>`; + } + + if (await emails.getLdpContains().length > 0 ) { + 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> + <solid-display class="segment width-90" bind-resources="" fields="emails" + widget-emails="customtzcld-display-user-profile-emails" + data-src="${await job}" solid-resource=""></solid-display> + </div>`; } - - render += `<solid-display class="segment block margin-bottom-small" bind-resources="" fields="phones" - widget-phones="customtzcld-display-user-profile-phones" - data-src="${await job}" solid-resource=""></solid-display>`; - render += `<solid-display class="segment block" bind-resources="" fields="emails" - widget-emails="customtzcld-display-user-profile-emails" - data-src="${await job}" solid-resource=""></solid-display>`; - render += `</div>`; render += `</div>`; } -- GitLab