Newer
Older
import(/* @vite-ignore */utils.coreVersion()).then((core) => {
core.Sib.register({
name: "tzcld-circle-members-display",
use: [core.StoreMixin],
empty() {
this.element.innerHTML = "";
},
async populate() {
this.element.innerHTML = `
<div class="tzcld-circle-members-display-loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`;
let tzcldprofile = {
id: await this.resource['@id'],
};
if("label" in this.element.attributes) {
for(let ignore of this.element.attributes['label'].value.split(',')) {
tzcldprofile[ignore.trim()] = null;
}
}
let render = `
<solid-widget name="tzcld-orbit-circle-team-contact">
<template>
<solid-link class="icon icon-secondary hover icon-info margin-left-xsmall margin-right-xxsmall" data-src="\${value}" next="members-member-profile"></solid-link>
<solid-link class="icon icon-secondary hover icon-speech margin-left-xxsmall margin-right-medium" data-src="\${value}" next="messages"></solid-link>
</template>
</solid-widget>
<solid-widget name="tzcld-orbit-circle-members-list">
<template>
<solid-display class="segment full labelled-avatar two-lines whitespace-normal children children-full sm-children-full children-margin-bottom-medium circle-members"
data-src="\${src || value}"
array-field='user_set'
loader-id='tzcld-circle-members-display-loader'
fields='segment1(account.picture), segment2(line1(name), line2(tzcld_profile.jobs)), @id'
class-segment1='segment'
class-segment2='segment three-quarter margin-left-xsmall'
class-line1='segment block'
class-name='text-xlarge text-wheigt-800 text-color-heading text-sub'
class-id='user-actions'
class-line2='segment block'
class-atom='icon icon-large icon-third mdi-atom margin-right-xxsmall'
class-communities='full'
multiple-communities
multiple-communities-fields='name'
widget-id='tzcld-orbit-circle-team-contact'
widget-account.picture='orbit-user-avatar'
widget-tzcld_profile.jobs='customtzcld-display-user-profile-first-jobs'
></solid-display>
</template>
</solid-widget>
<solid-display
data-src="${tzcldprofile.id}"
fields='members'
widget-members='tzcld-orbit-circle-members-list'
loader-id='tzcld-circle-members-display-loader'
></solid-display>`;
this.element.innerHTML = render;
},
});
core.Sib.register({
name: "customtzcld-display-user-profile-phones",
use: [core.StoreMixin],
empty() {
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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) {
render += `<div class="phone">${await phone.phone} ${await phone.phone_type}</div>`;
}
this.element.innerHTML = render;
},
});
core.Sib.register({
name: "customtzcld-display-user-profile-emails",
use: [core.StoreMixin],
empty() {
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
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) {
render += `<div class="email"><a class="link" href="mailto:${await email.email}">${await email.email}</a> ${await email.email_type}</div>`;
}
this.element.innerHTML = render;
},
});
core.Sib.register({
name: "customtzcld-display-user-profile-jobs",
use: [core.StoreMixin],
empty() {
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
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) {
if(await job.organisation !="") {
if(await job.link !="") {
render += `<h3 class="position text-medium padding-bottom-large">${await job.position} à <a class="link text-top" href="${await job.link}">${await job.organisation}</a></h3>`;
} else {
render += `<h3 class="position text-medium padding-bottom-large">${await job.position} à ${await job.organisation}</h3>`;
}
} else {
render += `<h3 class="position text-medium padding-bottom-large">${await job.position}</h3>`;
}
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 padding-bottom-small">`;
}
if (await job.mobile_phone != '') {
render += `${await job.phone}`;
}
if ((await job.mobile_phone != '') && (await job.phone != '')) {
render += ` - `;
}
if (await job.mobile_phone != '') {
render += `${await job.mobile_phone}`;
}
if ((await job.mobile_phone != '') || (await job.phone != '')) {
render += `</div>`;
}
if (await job.email != '') {
render += `<div class="email padding-bottom-small"><a class="link text-top" href="mailto:${await job.email}">${await job.email}</a></div>`;
}
}
render += `</div>`;
this.element.innerHTML = render;
},
});
});
});