diff --git a/src/styles/index.scss b/src/styles/index.scss index f4472883a895e0aca9eb1a88d53e4485a0716ffa..0786ec51bd0dda03598061af70a1d01089b2a8e0 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -388,4 +388,18 @@ main div[data-view] { .avatar.medium { height: 72px; width: 72px; +} + + +/* temp fix for resources */ + + +.resourcedetail solid-display-value-markdown p { + margin: 0 0 10px 0; +} +.resourcedetail solid-display-value-markdown ul { + list-style: disc; + margin: 0 0 10px 0; + padding: 0 0 10px 10px; + list-style-position: inside; } \ No newline at end of file diff --git a/src/utils.js b/src/utils.js index 6c733370f2641b9ebfdb21883f9bc344506f05aa..605cc6c602e0b78f670b4b59fcb51dc9de2daa77 100644 --- a/src/utils.js +++ b/src/utils.js @@ -6,6 +6,7 @@ export const TZCLD_URLS = { my_territory_infos: 'tzcld-presentation-territoire', my_territory_auto_eval: 'tzcld-auto-evaluation', my_territory_follow: 'tzcld-suivit', + my_territory_exchanges: 'tzcld-echnages', } export function path() { diff --git a/src/views-terrytories.js b/src/views-terrytories.js index 20c3804e18acb34bc03f011cef5f0581de7cbcbb..d3b383ef0d0ec166c54bfe36e553ec68d414f7c7 100644 --- a/src/views-terrytories.js +++ b/src/views-terrytories.js @@ -37,12 +37,62 @@ import("./utils.js").then((utils) => { <solid-route name="${utils.TZCLD_URLS.my_territory_space}"></solid-route> <solid-route name="${utils.TZCLD_URLS.my_territories}"></solid-route> <solid-route name="${utils.TZCLD_URLS.my_territory_infos}" use-id></solid-route> + <solid-route name="${utils.TZCLD_URLS.my_territory_exchanges}" use-id></solid-route> <solid-route name="${utils.TZCLD_URLS.my_territory_auto_eval}" use-id></solid-route> </solid-router> `; return render; } + + viewRightMenu(default_root) { + let render = ` + <nav class="jsRightMenu segment sm-hidden text-disable-selection sidebar whitespace-normal" role="navigation"> + <solid-router class="segment whitespace-normal text-color-heading text-bold" default-route="" > + <ul> + <li class="segment full sm-hidden padding-small text-normal jsOffsiteToggle"> + <span class="icon icon-arrow-left icon-xsmall margin-left-xxsmall text-left"></span> + <span class="segment full text-right" hidden=""> + <span class="icon icon-arrow-right icon-xsmall margin-right-xxsmall"></span> + <a data-trans="territory.menuRight.fold">Replier le menu</a> + </span> + </li> + <solid-route class="segment full" name="${utils.TZCLD_URLS.my_territory_infos}" use-id=""> + <li class="segment full padding-medium"> + <span class="tz2icon-ion_earth-outline icon-xlarge margin-right-medium"></span> + <a data-trans="territory.menuRight.presentation">Présentation</a> + </li> + </solid-route> + <solid-ac-checker permission="acl:Write" nested-field="tzcld_profile_identity" bind-resources> + <solid-route class="segment full" name="${utils.TZCLD_URLS.my_territory_exchanges}" use-id="" > + <li class="segment full padding-medium"> + <span class="icon ci-chat icon-xlarge margin-right-medium"></span> + <a data-trans="territory.menuRight.echanges">Échanges avec mes référent-es</a> + </li> + </solid-route> + </solid-ac-checker> + <solid-ac-checker permission="acl:Write" nested-field="tzcld_profile_identity" bind-resources> + <solid-route class="segment full" name="${utils.TZCLD_URLS.my_territory_auto_eval}" use-id="" > + <li class="segment full padding-medium"> + <span class="tz2icon-carbon_chart-evaluation icon-xlarge margin-right-medium"></span> + <a data-trans="territory.menuRight.autoevaluation">Auto-évaluation</a> + </li> + </solid-route> + </solid-ac-checker> + <solid-ac-checker permission="acl:Write" nested-field="tzcld_community_synthesis_followed" bind-resources> + <solid-route class="segment full" name="${utils.TZCLD_URLS.my_territory_follow}" use-id="" > + <li class="segment full padding-medium"> + <span class="tz2icon-info icon-xlarge margin-right-medium"></span> + <a data-trans="territory.menuRight.autoevaluation">Auto-évaluation</a> + </li> + </solid-route> + </solid-ac-checker> + </ul> + </solid-router> + </nav>`; + return render; + } + viewWidgets() { let render = ` @@ -138,6 +188,46 @@ import("./utils.js").then((utils) => { <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-exchanges-conversations-couter"> + <template> + <div style="float:right"> + <solid-display fields="" data-src="\${src || value}" nested-field="conversations" counter-template="\\\${counter}"></solid-display> + <span class="margin-right-xxsmall">Commentaires</span> + </div> + </template> + </solid-widget> + <solid-widget name="tzcld-format-date-1"> + <template> + <span class="">\${moment(await value.toString()).locale('fr').format('Do/MM/YY')}</span> + </template> + </solid-widget> + + <solid-widget name='tzcld-regions-referent-jobs'> + <template> + <solid-display + solid-resource="" + data-src="\${src || value}" + fields="segment1(segment2(member-picture(account.picture)), segment3(name, segment5(tzcld_profile.jobs)), @id)" + class="segment full children children-full children-margin-bottom-medium whitespace-normal" + 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 three-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-account.picture="avatar medium" + class-name="block margin-top-xsmall margin-bottom-xxsmall text-xlarge text-bold text-color-heading whitespace-normal" + class-id="user-actions" + widget-tzcld_profile.jobs="customtzcld-display-user-profile-first-job-referent-short" + widget-account.picture="orbit-user-avatar" + widget-name="h3" + widget-id="tzcld-orbit-territory-team-contact-actions" + next="members-member-profile" + paginate-by="20" + ></solid-display> + </span> + </template> + </solid-widget> `; return render; @@ -167,6 +257,55 @@ import("./utils.js").then((utils) => { </solid-display>`; + render += ` + </div>`; + + return render; + }exchanges + viewExchanges() { + let render = ` + <div class="segment block margin-right-xxsmall margin-left-xxsmall sm-margin-none padding-top-none sm-padding-xsmall"> + + <div class="segment two-third padding-xsmall whitespace-normal"> + <div class="loader" id="loader-${this.route}-tzcld-exchanges"> + <div></div> + <div></div> + <div></div> + <div></div> + </div> + <solid-display + fields="segment1(segment2(title(title_prefix, date), user.name, longdesc), segment3(counter))" + class="segment block whitespace-normal" + class-segment1="segment hover bg-color-white shadow border-rounded-xxsmall full text-top whitespace-normal cursor-pointer" + class-segment2="segment block padding-xlarge text-left" + class-segment3="segment block padding-xlarge sm-padding-medium border-top border-color-grey text-center whitespace-normal" + widget-title="h2" + widget-title_prefix="span" + widget-date="tzcld-format-date-1" + widget-longdesc="div" + value-title_prefix="Note du " + label-user.name="De " + loader-id="loader-${this.route}-tzcld-exchanges" + widget-edit="communities-edit-button-${utils.community_uniq()}" + bind-resources="" + nested-field="tzcld_community_shared_notes" + action-counter="counter" + widget-counter="tzcld-exchanges-conversations-couter" + solid-resource="" + > + </solid-display> + </div> + <div class="segment third padding-xsmall whitespace-normal"> + <solid-display + bind-resources="" + nested-field="tzcld_profile.regions" + fields="referents" + widget-referents="tzcld-regions-referent-jobs" + > + </solid-display> + </div> + `; + render += ` </div>`; @@ -241,46 +380,6 @@ import("./utils.js").then((utils) => { </div>`; return render; } - viewRightMenu(default_root) { - let render = ` - <nav class="jsRightMenu segment sm-hidden text-disable-selection sidebar whitespace-normal" role="navigation"> - <solid-router class="segment whitespace-normal text-color-heading text-bold" default-route="" > - <ul> - <li class="segment full sm-hidden padding-small text-normal jsOffsiteToggle"> - <span class="icon icon-arrow-left icon-xsmall margin-left-xxsmall text-left"></span> - <span class="segment full text-right" hidden=""> - <span class="icon icon-arrow-right icon-xsmall margin-right-xxsmall"></span> - <a data-trans="territory.menuRight.fold">Replier le menu</a> - </span> - </li> - <solid-route class="segment full" name="${utils.TZCLD_URLS.my_territory_infos}" use-id=""> - <li class="segment full padding-medium"> - <span class="tz2icon-ion_earth-outline icon-xlarge margin-right-medium"></span> - <a data-trans="territory.menuRight.presentation">Présentation</a> - </li> - </solid-route> - <solid-ac-checker permission="acl:Write" nested-field="tzcld_profile_identity" bind-resources> - <solid-route class="segment full" name="${utils.TZCLD_URLS.my_territory_auto_eval}" use-id="" > - <li class="segment full padding-medium"> - <span class="tz2icon-carbon_chart-evaluation icon-xlarge margin-right-medium"></span> - <a data-trans="territory.menuRight.autoevaluation">Auto-évaluation</a> - </li> - </solid-route> - </solid-ac-checker> - <solid-ac-checker permission="acl:Write" nested-field="tzcld_community_synthesis_followed" bind-resources> - <solid-route class="segment full" name="${utils.TZCLD_URLS.my_territory_follow}" use-id="" > - <li class="segment full padding-medium"> - <span class="tz2icon-info icon-xlarge margin-right-medium"></span> - <a data-trans="territory.menuRight.autoevaluation">Auto-évaluation</a> - </li> - </solid-route> - </solid-ac-checker> - </ul> - </solid-router> - </nav>`; - return render; - } - viewCommunityAnswers() { @@ -557,7 +656,7 @@ import("./utils.js").then((utils) => { ${this.viewWidgets()} ${this.viewMyCommunities()} <div id="${utils.TZCLD_URLS.my_territory_space}" data-view="${utils.TZCLD_URLS.my_territory_space}" hidden> - + <div class="with-sidebar whitespace-normal jsMobileContentSidebarControl"> <div class="scrollbar-content views-container padding-top-xlarge sidebar-is-closed"> @@ -565,6 +664,10 @@ import("./utils.js").then((utils) => { ${this.viewMyCommunity()} </div> + <div id="${utils.TZCLD_URLS.my_territory_exchanges}" data-view="${utils.TZCLD_URLS.my_territory_exchanges}" class="community-exchanges" hidden> + ${this.viewExchanges()} + </div> + <div id="${utils.TZCLD_URLS.my_territory_auto_eval}" data-view="${utils.TZCLD_URLS.my_territory_auto_eval}" class="community-answers" hidden> ${this.viewCommunityAnswers()} </div> diff --git a/src/widjets-display-user-tzcld.js b/src/widjets-display-user-tzcld.js index 142b62102a99b7a9f48e06192b8ca724bcad25e4..36bd49187aad08bfd7c332ac465357887db1893e 100644 --- a/src/widjets-display-user-tzcld.js +++ b/src/widjets-display-user-tzcld.js @@ -276,6 +276,69 @@ import("./utils.js").then((utils) => { render += `</div>`; + 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; }, });