diff --git a/src/custom-tzcld.js b/src/custom-tzcld.js index 26eebf726dec6fc8bfa49f59ad453ae8262f7fb8..6e5f285b9e3c0ee9a03e7ffec8e0965ba509d2be 100644 --- a/src/custom-tzcld.js +++ b/src/custom-tzcld.js @@ -202,13 +202,6 @@ import("./utils.js").then((utils) => { \${value != "" ? \`- \${value}\` : \`\`} </template> </solid-widget> - <solid-widget name="tzcld-communities-logo"> - <template> - <div class="communities-logo"> - \${value != "" ? \`<div \style="background-image:url(\${value});" />\` : \`<div></div>\`} - </div> - </template> - </solid-widget> <div id="tzcld-user-profile-wrapper" class="tzcld-user-profile-wrapper segment full"> <div id="tzcld-user-profile-col1" class="tzcld-user-profile-col1 segment width-40 padding-right-60"> diff --git a/src/styles/index.scss b/src/styles/index.scss index d545b5b72022ddd73c8195cb1ea34bcc63d87a99..f4472883a895e0aca9eb1a88d53e4485a0716ffa 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -382,4 +382,10 @@ main div[data-view] { } .text-xbold { font-weight: 800; +} + +/* custom size avatar */ +.avatar.medium { + height: 72px; + width: 72px; } \ No newline at end of file diff --git a/src/styles/territory-profile.scss b/src/styles/territory-profile.scss index 3104cfeb736a2643e32da897fda2666431836c21..7c25e757e387402a658389e5b99f5ba99cb50d92 100644 --- a/src/styles/territory-profile.scss +++ b/src/styles/territory-profile.scss @@ -99,5 +99,29 @@ z-index: 1; } } + .tzcld-other-contacts-list { + margin-left: - 10px; + [name="segment2"] { + vertical-align: middle; + } + [name="segment3"] { + vertical-align: top; + } + + .user-actions { + position: absolute; + top: -8px; + right: -4px; + .icon { + display: inline-block; + padding: 10px; + border-radius: 50%; + background: var(--color-primary); + &:before { + color: #fff!important; + } + } + } + } } \ No newline at end of file diff --git a/src/views-terrytories.js b/src/views-terrytories.js index dc568bcbe9e13cc46e5f5cfc1c262996176dcf6b..8e3a95e95ef87bab0c3e48748ace53267fcd71d6 100644 --- a/src/views-terrytories.js +++ b/src/views-terrytories.js @@ -48,6 +48,13 @@ import("./utils.js").then((utils) => { let render = ` + <solid-widget name="tzcld-communities-logo"> + <template> + <div class="communities-logo"> + \${value != "" ? \`<div \style="background-image:url(\${value});" />\` : \`<div></div>\`} + </div> + </template> + </solid-widget> <solid-widget name="tzcld-communities-counter-alternate"> <template> @@ -118,6 +125,19 @@ import("./utils.js").then((utils) => { \${value != "" ? \`<div style="background-image:url(\${value});" />\` : ""} </template> </solid-widget> + <solid-widget name="territory-no-secondary-contact"> + <template> + <div class="segment bg-color-white shadow full text-top whitespace-normal margin-left-xsmall"> + <p class="padding-xxlarge">Pas de contact</p> + </div> + </template> + </solid-widget> + <solid-widget name="tzcld-orbit-territory-team-contact-actions"> + <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> `; return render; @@ -167,7 +187,9 @@ import("./utils.js").then((utils) => { <solid-form-search class="form search-form sm-whitespace-normal" id="my-communities-filter" - fields="name, segment1(tzcld_profile.regions, tzcld_profile.kind, tzcld_profile.step_state)" + fields="name, segment1(tzcld_profile.regions, tzcld_profile.kind, tzcld_profile.step_state, tzcld_profile.visible)" + value-tzcld_profile.visible=true + class-tzcld_profile.visible="hidden" class-name="segment margin-bottom-small full sm-full padding-right-xsmall padding-left-xsmall sm-padding-none input-shadow input-bg-white icon icon-magnify text-xlarge text-semibold text-color-heading" submit-button="Rechercher" submit-widget="button" diff --git a/src/widjets-display-territory-tzcld.js b/src/widjets-display-territory-tzcld.js index b581f5bc12594f5e9047d0d4220f004e5becb29d..230c2c38e9c12c22d5943aca3e0fad6d8ffc4e95 100644 --- a/src/widjets-display-territory-tzcld.js +++ b/src/widjets-display-territory-tzcld.js @@ -288,7 +288,10 @@ import("./utils.js").then((utils) => { render += `<div id="tzcld-territory-profile-wrapper2" class="tzcld-territory-profile-wrapper2 segment full margin-top-large">`; - render += `<div class="tzcld-territory-profile-primary-contact segment width-30 padding-right-large">` ; + render += `<div class="tzcld-territory-profile-primary-contact segment width-30 padding-right-large"> + + + ` ; if ((await primaryContact.resource !== null) && (await primaryContact.resource.user !== undefined)) { render += `<div id="loaderfirst-contact-territory" class="loader loader-top" hidden=""> <div></div> @@ -320,8 +323,8 @@ import("./utils.js").then((utils) => { value-send="" label-view="" value-view="" - class-send="send-display children-link-rounded children-icon-speech children-link-reversed color-secondary bordered" - class-view="view-display children-link-rounded children-icon-info children-link-reversed color-secondary bordered" + class-send="send-display children-link-rounded children-icon-speech children-link-reversed color-primary bordered" + class-view="view-display children-link-rounded children-icon-info children-link-reversed color-primary bordered" value-at="@" widget-account.picture="orbit-user-avatar" role="button" @@ -348,7 +351,53 @@ import("./utils.js").then((utils) => { render += `<solid-display class="segment full" bind-resources="" nested-field="tzcld_profile" fields="locations" widget-locations="customtzcld-display-territory-profile-locations" class-locations="display-ebes" data-src="${tzcldprofile.id}" solid-resource="" paginate-by="10"></solid-display>`; - render += `</div></div>`; //col 2 + render += `</div> + + + <h2 class="tzcld-h2">Autres contacts</h2> + <div id="loader-all-contact-territory" class="loader loader-top" hidden=""> + <div></div> + <div></div> + <div></div> + <div></div> + </div> + <solid-form-search + class="hidden" + id="tzcld-secondary-contacts-filter-${utils.getIntId(tzcldprofile.id)}" + nested-field="members" + fields="is_admin" + value-is_admin=false + submit-button="Rechercher" + submit-widget="button" + naked="" + ></solid-form-search> + + <solid-display + filtered-by="tzcld-secondary-contacts-filter-${utils.getIntId(tzcldprofile.id)}" + empty-value="Aucun contact" + empty-widget="territory-no-secondary-contact" + loader-id="loader-all-contact-territory" + class="segment full children children-half sm-children-full children-margin-bottom-medium sm-children-margin-bottom-xsmall children-padding-left-xsmall sm-children-padding-none sm-whitespace-normal masonry counter pagination tzcld-other-contacts-list" + data-src="${tzcldprofile.id}" + nested-field="members" + fields="segment1(segment2(member-picture(user.account.picture)), segment3(user.name, segment5(user.tzcld_profile.jobs)), user)" + class-segment1="segment bg-color-white shadow full text-top whitespace-normal" + class-segment2="segment quarter padding-medium text-center whitespace-normal" + class-segment3="segment tree-quarter padding-top-xxsmall padding-right-small padding-bottom-small whitespace-normal" + class-segment5="segment full padding-none padding-top-xsmall text-left whitespace-normal" + class-member-picture="segment avatar-wrapper" + class-user.account.picture="avatar medium" + class-user.name="block margin-top-xsmall margin-bottom-xxsmall text-xlarge text-bold text-color-heading whitespace-normal" + class-user="user-actions" + + widget-user.account.picture="orbit-user-avatar" + widget-user.name="h3" + widget-user.tzcld_profile.jobs="customtzcld-display-user-profile-first-job-short" + widget-user="tzcld-orbit-territory-team-contact-actions" + next="members-member-profile" + solid-resource="" paginate-by="20"></solid-display> + + </div>`; //col 2 this.element.innerHTML = render; },