diff --git a/src/index.js b/src/index.js index aca6a83f928b15872c900d3e8b76687409f48454..411366dc1fd4f0951d2eb311e8acb6fa0cd22a45 100644 --- a/src/index.js +++ b/src/index.js @@ -15,6 +15,7 @@ import('./utils.js').then(utils => { core.Helpers.importCSS(utils.path() + '/styles/follow.css?min'); core.Helpers.importCSS(utils.path() + '/styles/accordions.css?min'); core.Helpers.importCSS(utils.path() + '/styles/shared-files.css?min'); + core.Helpers.importCSS(utils.path() + '/styles/breadcrum.css?min'); core.Helpers.importCSS(utils.path() + '/styles/tzcld-icons.css?min'); @@ -26,6 +27,7 @@ import('./utils.js').then(utils => { await import("./widjets-display-evaluation-tzcld.js"); await import("./widjets-display-follow-tzcld.js"); await import("./widjets-display-shared-files.js"); + await import("./widjets-display-breadcrum.js"); }); }); \ No newline at end of file diff --git a/src/styles/breadcrum.scss b/src/styles/breadcrum.scss new file mode 100644 index 0000000000000000000000000000000000000000..ed7d357afeb8b8f0d88236c24b0f1e0abf38a9db --- /dev/null +++ b/src/styles/breadcrum.scss @@ -0,0 +1,34 @@ + +.tzcld-breadcrum { + padding-left: 5px; + padding-bottom: 16px; + font-size: 12px; + font-style: normal; + font-weight: 500; + line-height: normal; + color: var(--color-secondary); + + solid-link { + font-size: 12px; + font-style: normal; + font-weight: 500; + line-height: normal; + text-decoration-line: underline; + color: var(--color-secondary); + } +} +#tzcld-suivit-requests { + .tzcld-breadcrum { + padding: 30px 0 16px 29px; + } +} +#tzcld-suivit { + .tzcld-breadcrum { + padding: 0 0 16px 24px; + } +} +#tzcld-echnages { + .tzcld-breadcrum { + padding-left: 10px; + } +} \ No newline at end of file diff --git a/src/styles/requests.scss b/src/styles/requests.scss index 5658c7a530b46aa566abdcd1776dc5ceec8bb5d6..823d92559e424a557ee5ee15e29c81645b7a3ff8 100644 --- a/src/styles/requests.scss +++ b/src/styles/requests.scss @@ -34,7 +34,7 @@ margin-left: -24px; margin-right: -15px; &>div { - padding: 30px 15px 30px 24px; + padding: 16px 15px 30px 24px; } nav { width: 100%; diff --git a/src/views-terrytories.js b/src/views-terrytories.js index c916e6ada99caefa1042d5c40d908b97497c6dda..0746c168f3a6c1f600889a176c9f4cf3a95544b1 100644 --- a/src/views-terrytories.js +++ b/src/views-terrytories.js @@ -701,13 +701,15 @@ import("./utils.js").then((utils) => { class-training_course="segment margin-bottom-medium third sm-full padding-right-small sm-padding-none text-xlarge text-semibold text-color-heading" class-training_promotoion="segment margin-bottom-medium third sm-full padding-left-small sm-padding-none text-xlarge text-semibold text-color-heading" class-training_person="segment margin-bottom-medium third sm-full padding-left-small sm-padding-none text-xlarge text-semibold text-color-heading" - label-training_course="Suivit du parcours Territoire * :" + label-training_course="Choix du parcours suivi * :" label-training_promotoion="Numéro de promotion * :" required-training_course required-training_promotoion - label-training_person="Personne ayant suivit la formation :" + label-training_person="Personne ayant suivi la formation :" range-training_course="${this.territoriesTrainingCourses}" + order-asc-training_course="name" range-training_promotoion="${this.territoriesTrainingPromotions}" + order-asc-training_promotoion="name" widget-training_course="solid-form-dropdown-label" widget-training_promotoion="solid-form-dropdown-label" ></solid-form> @@ -756,7 +758,8 @@ import("./utils.js").then((utils) => { widget-origin_mobilization="solid-form-dropdown-label" - range-origin_mobilization=${this.territoriesOriginsMobilisation}" + range-origin_mobilization="${this.territoriesOriginsMobilisation}" + order-asc-origin_mobilization="name" widget-application_date="solid-form-date-label" @@ -1012,7 +1015,7 @@ import("./utils.js").then((utils) => { <a class="backlink text-xlarge line-xlarge margin-right-xxsmall" href="javascript:history.back();">Retour</a> </div> - <h2 class="margin-top-xxsmall margin-left-xsmall margin-bottom-medium sm-margin-none sm-margin-right-xsmall sm-margin-bottom-small sm-margin-left-xsmall text-xlarge text-bold text-color-heading text-uppercase">Suivoit interne - échanges</h2> + <h2 class="margin-top-xxsmall margin-left-xsmall margin-bottom-medium sm-margin-none sm-margin-right-xsmall sm-margin-bottom-small sm-margin-left-xsmall text-xlarge text-bold text-color-heading text-uppercase">Suivi interne - échanges</h2> <p class="text-right padding-none margin-none"><solid-link class="segment margin-top-xxlarge sm-full button text-xsmall text-bold text-uppercase text-center color-secondary bordered button-icon icon icon-square-edit icon-margin-right-xsmall" bind-resources next="${utils.TZCLD_URLS.my_territory_follow_request_add}">Ajouter un échange</solid-link></p> @@ -1096,17 +1099,17 @@ import("./utils.js").then((utils) => { widget-title="h2" class-title="margin-bottom-large margin-top-none margin-left-none text-xlarge text-xbold text-color-heading text-color-dark-blue" widget-title_prefix="span" - value-title_prefix="Nouvelle entrée pour l'historique des échanges" + value-title_prefix="Ajout d'un échange" label-date="Date" label-contactType="Type de contact" label-subject="Sujet/demande" - label-user="Interlmocuteur" + label-user="Interlocuteur" widget-date="solid-form-date-label" widget-subject="solid-form-textarea-label" widget-user="solid-form-dropdown-autocompletion-label" - order-asc-user="username" + order-asc-user="name" range-user="${this.rangeUser}" loader-id="loader-${this.route}-${utils.TZCLD_URLS.my_territory_follow_request_add}" bind-resources="" @@ -1159,17 +1162,17 @@ import("./utils.js").then((utils) => { widget-title="h2" class-title="margin-bottom-large margin-top-none margin-left-none text-xlarge text-xbold text-color-heading text-color-dark-blue" widget-title_prefix="span" - value-title_prefix="Nouvelle entrée pour l'historique des échanges" + value-title_prefix="Modifier un échange" label-date="Date" label-contactType="Type de contact" label-subject="Sujet/demande" - label-user="Interlmocuteur" + label-user="Interlocuteur" widget-date="solid-form-date-label" widget-subject="solid-form-textarea-label" widget-user="solid-form-dropdown-autocompletion-label" - order-asc-user="username" + order-asc-user="name" range-user="${this.rangeUser}" loader-id="loader-${this.route}-${utils.TZCLD_URLS.my_territory_follow_requests_edit}" bind-resources="" @@ -1310,6 +1313,28 @@ import("./utils.js").then((utils) => { return render; } + tzcldBreadcrum(subNext= false, subText= false, nested= false) { + + let nestedField = '' ; + if (nested) { + nestedField = ` nested-field="${nested}"` ; + } + let render = `<div class="tzcld-breadcrum"> + <customtzcld-display-breadcrum-my-territory bind-resources soid-resource${nestedField}></customtzcld-display-breadcrum-my-territory>` ; + + if (subNext && subText) { + render += ` + > + <solid-link next="${subNext}" link-text="">${subText}</solid-link> + `; + } + render += ` + </div>`; + + + return render ; + } + template(props) { this.uniq = props.uniq || utils.uniq(); @@ -1326,7 +1351,7 @@ import("./utils.js").then((utils) => { this.regions = props.regions ; this.kinds = props.kinds ; this.territoriesStepStates = props.territoriesStapeStates ; - this.territoriesOriginsMobilisation = props.territoriesOriginsMobilisationn ; + this.territoriesOriginsMobilisation = props.territoriesOriginsMobilisation ; this.apiUrl = props.apiUrl ; this.rangeUser = props.rangeUser ; this.uploads = props.uploads ; @@ -1344,22 +1369,28 @@ import("./utils.js").then((utils) => { <div class="with-sidebar whitespace-normal jsMobileContentSidebarControl"> <div class="scrollbar-content views-container padding-top-xlarge padding-right-small sidebar-is-closed"> <div id="${utils.TZCLD_URLS.my_territory_infos}" data-view="${utils.TZCLD_URLS.my_territory_infos}" class="community-my-community community-profile" hidden> + ${this.tzcldBreadcrum()} ${this.viewMyCommunity()} </div> - <div id="${utils.TZCLD_URLS.my_territory_exchanges}" data-view="${utils.TZCLD_URLS.my_territory_exchanges}" class="community-exchanges home" hidden> - ${this.viewExchanges()} - </div> + <div id="${utils.TZCLD_URLS.my_territory_exchanges}" data-view="${utils.TZCLD_URLS.my_territory_exchanges}" class="community-exchanges home" hidden> + ${this.tzcldBreadcrum()} + ${this.viewExchanges()} + </div> - <div id="${utils.TZCLD_URLS.my_territory_add_exchange}" data-view="${utils.TZCLD_URLS.my_territory_add_exchange}" class="community-exchanges add" hidden> - ${this.viewAddExchange()} - </div> + <div id="${utils.TZCLD_URLS.my_territory_add_exchange}" data-view="${utils.TZCLD_URLS.my_territory_add_exchange}" class="community-exchanges add" hidden> + ${this.tzcldBreadcrum(utils.TZCLD_URLS.my_territory_exchanges, 'Échanges avec mes référent-es')} + ${this.viewAddExchange()} + </div> - <div id="${utils.TZCLD_URLS.my_territory_all_exchanges}" data-view="${utils.TZCLD_URLS.my_territory_all_exchanges}" class="community-exchanges all" hidden> - ${this.viewAllExchanges()} - </div> + <div id="${utils.TZCLD_URLS.my_territory_all_exchanges}" data-view="${utils.TZCLD_URLS.my_territory_all_exchanges}" class="community-exchanges all" hidden> + ${this.tzcldBreadcrum(utils.TZCLD_URLS.my_territory_exchanges, 'Échanges avec mes référent-es')} + ${this.viewAllExchanges()} + </div> - <div id="${utils.TZCLD_URLS.my_territory_exchange_space}" data-view="${utils.TZCLD_URLS.my_territory_exchange_space}" class="community-exchanges one" hidden> + <div id="${utils.TZCLD_URLS.my_territory_exchange_space}" data-view="${utils.TZCLD_URLS.my_territory_exchange_space}" class="community-exchanges one" hidden> + + ${this.tzcldBreadcrum(utils.TZCLD_URLS.my_territory_exchanges, 'Échanges avec mes référent-es', 'community_admins.community')} <solid-router default-route="my_territory_all_exchanges_empty" route-prefix=""> <solid-route name="my_territory_all_exchanges_empty" use-id></solid-route> <solid-route name="${utils.TZCLD_URLS.my_territory_exchange}" use-id></solid-route> @@ -1402,6 +1433,7 @@ import("./utils.js").then((utils) => { </div> <div id="${utils.TZCLD_URLS.my_territory_follow_request_space}" data-view="${utils.TZCLD_URLS.my_territory_follow_request_space}" class="community-folow-request one" hidden> + ${this.tzcldBreadcrum(utils.TZCLD_URLS.my_territory_follow, 'Suivi interne', 'community')} <solid-router default-route="my_territory_follow_request_empty" route-prefix=""> <solid-route name="my_territory_follow_request_empty" use-id></solid-route> <solid-route name="${utils.TZCLD_URLS.my_territory_follow_request_edit}" use-id></solid-route> @@ -1415,18 +1447,22 @@ import("./utils.js").then((utils) => { </div> <div id="${utils.TZCLD_URLS.my_territory_auto_eval}" data-view="${utils.TZCLD_URLS.my_territory_auto_eval}" class="community-answers" hidden> + ${this.tzcldBreadcrum()} ${this.viewCommunityAnswers()} </div> <div id="${utils.TZCLD_URLS.my_territory_follow}" data-view="${utils.TZCLD_URLS.my_territory_follow}" class="community-answers padding-top-xlarge" hidden> + ${this.tzcldBreadcrum()} ${this.viewCommunityFollow()} </div> <div id="${utils.TZCLD_URLS.my_territory_follow_requests_all}" data-view="${utils.TZCLD_URLS.my_territory_follow_requests_all}" class="community-answers" hidden> + ${this.tzcldBreadcrum(utils.TZCLD_URLS.my_territory_follow, 'Suivi interne')} ${this.viewCommunityFollowRequestsAll()} </div> <div id="${utils.TZCLD_URLS.my_territory_follow_request_add}" data-view="${utils.TZCLD_URLS.my_territory_follow_request_add}" class="community-answers" hidden> + ${this.tzcldBreadcrum(utils.TZCLD_URLS.my_territory_follow, 'Suivi interne')} ${this.viewCommunityFollowRequestAdd()} </div> diff --git a/src/widjets-display-breadcrum.js b/src/widjets-display-breadcrum.js new file mode 100644 index 0000000000000000000000000000000000000000..f14c208e6981caa7a98a3b12cd9258115398478b --- /dev/null +++ b/src/widjets-display-breadcrum.js @@ -0,0 +1,38 @@ +import("./utils.js").then((utils) => { + import(utils.coreVersion()).then((core) => { + + core.Sib.register({ + name: "customtzcld-display-breadcrum-my-territory", + 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 tzcldprofile = { + community: await this.resource + }; + + if("label" in this.element.attributes) { + for(let ignore of this.element.attributes['label'].value.split(',')) { + tzcldprofile[ignore.trim()] = null; + } + } + let render = `<solid-link next="tzcld" link-text="">Mes territoires</solid-link> + > + <solid-link data-src="${await tzcldprofile.community['@id']}" next="${utils.TZCLD_URLS.my_territory_infos}" link-text="">${await tzcldprofile.community.name}</solid-link>`; + + this.element.innerHTML = render; + }, + }); + }); +}); \ No newline at end of file diff --git a/src/widjets-display-territory-tzcld.js b/src/widjets-display-territory-tzcld.js index d927efd0d8b7fa0a9a437b0ef8b647107d4a8ca6..a615c975fee3904f7cfeecc318b0787e11048f2e 100644 --- a/src/widjets-display-territory-tzcld.js +++ b/src/widjets-display-territory-tzcld.js @@ -98,10 +98,13 @@ import("./utils.js").then((utils) => { } else { } + if ((await job.address != null) || (await job.city != null)) { 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 whitespace-normal">${await job.address} <br/> ${await job.postal_code} ${await job.city}</div> + <div class="segment width-90 whitespace-normal">${ ((await job.address != null) ? (await job.address)+'<br/>' : '') } ${((await job.postal_code != null) ? (await job.postal_code) : '' )} ${((await job.city != null) ? (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>