diff --git a/src/custom-tzcld.js b/src/custom-tzcld.js index 1fc5450276e605e6504bdfaed8b2ca42d35902bf..89238ed0ac86aae66589a3dd213f66fc9695fe73 100644 --- a/src/custom-tzcld.js +++ b/src/custom-tzcld.js @@ -342,11 +342,11 @@ import("./utils.js").then((utils) => { class="d-block rowClear orgs-wrapper" data-src="\${value}" data-holder - fields="segment11(position, organisation, link), segment12(address, postal_code), segment13(city, department), segment14(mobile_phone, mobile_phone_public), segment15(phone, phone_public), segment16(email, email_public), sep" + fields="segment11(position, organisation, link), segment12(address, postal_code), segment133(city, department), segment14(mobile_phone, mobile_phone_public), segment15(phone, phone_public), segment16(email, email_public), sep" value-profile="\${value}" class-segment11="segment full sm-full rowClear" class-segment12="segment full sm-full rowClear" - class-segment13="segment full sm-full rowClear" + class-segment133="segment full sm-full rowClear" class-segment14="segment full sm-full rowClear" class-segment15="segment full sm-full rowClear" class-segment16="segment full sm-full rowClear" @@ -385,7 +385,7 @@ import("./utils.js").then((utils) => { widget-phone_public="solid-form-checkbox-label" widget-mobile_phone_public="solid-form-checkbox-label" widget-email_public="solid-form-checkbox-label" - widget-department="solid-form-dropdown-label" + widget-department="solid-form-multipleselect-autocompletion-label" order-asc-department="name" range-department="${dataSrc}tzcld-departments/" required-position diff --git a/src/utils.js b/src/utils.js index 9267c9c13ba8a40e572849237ed5c8ec7010160c..3b45b85e9349cb33357dda0473503e82b1ad7495 100644 --- a/src/utils.js +++ b/src/utils.js @@ -6,6 +6,9 @@ export const TZCLD_URLS = { my_territory_infos: 'tzcld-presentation-territoire', my_territory_auto_eval: 'tzcld-auto-evaluation', my_territory_follow: 'tzcld-suivit', + my_territory_follow_requests_all: 'tzcld-suivit-requests', + my_territory_follow_request_add: 'tzcld-suivit-request-add', + my_territory_follow: 'tzcld-suivit', my_territory_exchanges: 'tzcld-echnages', my_territory_all_exchanges: 'tzcld-tous-les-echnages', my_territory_add_exchange: 'tzcld-add-echnage', diff --git a/src/views-terrytories.js b/src/views-terrytories.js index a11c56efdb495fcdad8d011afd81e14e9ce2bcb2..18a3cddd1256e376f4a9e857cd8f14014e997c54 100644 --- a/src/views-terrytories.js +++ b/src/views-terrytories.js @@ -89,6 +89,8 @@ import("./utils.js").then((utils) => { <solid-route name="${utils.TZCLD_URLS.my_territory_all_exchanges}" use-id></solid-route> <solid-route name="${utils.TZCLD_URLS.my_territory_add_exchange}" use-id></solid-route> <solid-route name="${utils.TZCLD_URLS.my_territory_exchange_space}" use-id></solid-route> + <solid-route name="${utils.TZCLD_URLS.my_territory_follow_requests_all}" use-id></solid-route> + <solid-route name="${utils.TZCLD_URLS.my_territory_follow_request_add}" use-id></solid-route> </ul> </solid-router> </nav>`; @@ -812,6 +814,46 @@ import("./utils.js").then((utils) => { let render = ` <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</h2> + + <div class="margin-bottom-large"> + <h2 class="margin-none margin-bottom-xsmall text-xlarge text-xbold text-color-heading">Historique des échanges</h2> + <div class="segment table-wrapper"> + <div class="table"> + <solid-form-search + id="tzcld-history-request-sorter" + fields="field, order" + enum-field="date" + class-field="hidden" + value-field="date" + value-order="desc" + enum-order="asc = asc, desc = desc" + ></solid-form-search> + <div class="table-header bg-color-third text-color-heading full"> + <div class="segment table-cell table-cell width-20">Date</div> + <div class="segment table-cell table-cell width-20">Type de contact</div> + <div class="segment table-cell table-cell width-20">Interlmocuteur</div> + <div class="segment table-cell table-cell width-20">Sujet/demande</div> + </div> + <solid-display + class="table-body full shadow bg-color-white" + bind-resources="" + nested-field="tzcld_community_requests" + fields="cell1(date), cell2(contactType), cell3(user.username), cell4(subject)" + class-cell1="segment table-cell width-20 text-center whitespace-normal" + class-cell2="segment table-cell width-20 whitespace-normal" + class-cell3="segment table-cell width-20 whitespace-normal" + class-cell4="segment table-cell width-20 whitespace-normal" + sorted-by="tzcld-history-request-sorter" + paginate-by="1" + > + </solid-display> + </div> + + <p class="text-right padding-right-xxlarge"><solid-link class="segment margin-top-xxlarge sm-full button text-xsmall text-bold text-uppercase text-center reversed color-secondary bordered button-icon icon icon-square-edit icon-margin-right-xsmall" bind-resources next="${utils.TZCLD_URLS.my_territory_follow_requests_all}">Voir tout</solid-link> + <solid-link class="segment margin-top-xxlarge margin-left-xxlarge margin-right-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</solid-link></p> + </div> + </div> + <div class="segment full shadow bg-color-white margin-bottom-large padding-large padding-left-small sm-padding-none whitespace-normal child-accordion"> <h2 class="margin-none text-xlarge text-xbold text-color-heading">Synthèse</h2> @@ -889,6 +931,110 @@ import("./utils.js").then((utils) => { </div>`; return render; } + + viewCommunityFollowRequestsAll() { + let render = ` + <div class="segment block margin-right-xxsmall margin-left-xxsmall sm-margin-none padding-top-none sm-padding-xsmall"> + <div class="segment block sm-hidden text-left"> + <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 - Echanges</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> + + <div class="margin-bottom-large"> + <h2 class="margin-none margin-bottom-xsmall text-xlarge text-xbold text-color-heading">Historique des tous les échanges</h2> + <div class="segment table-wrapper"> + <div class="table"> + <solid-form-search + id="tzcld-history-all-requests-sorter" + fields="field, order" + enum-field="date" + class-field="hidden" + value-field="date" + value-order="desc" + enum-order="asc = asc, desc = desc" + ></solid-form-search> + <div class="table-header bg-color-third text-color-heading full"> + <div class="segment table-cell table-cell width-20">Date</div> + <div class="segment table-cell table-cell width-20">Type de contact</div> + <div class="segment table-cell table-cell width-20">Interlmocuteur</div> + <div class="segment table-cell table-cell width-20">Sujet/demande</div> + </div> + <solid-display + class="table-body full shadow bg-color-white pagination" + bind-resources="" + nested-field="tzcld_community_requests" + fields="cell1(date), cell2(contactType), cell3(user.username), cell4(subject)" + class-cell1="segment table-cell width-20 text-center whitespace-normal" + class-cell2="segment table-cell width-20 whitespace-normal" + class-cell3="segment table-cell width-20 whitespace-normal" + class-cell4="segment table-cell width-20 whitespace-normal" + sorted-by="tzcld-history-all-requests-sorter" + paginate-by="1" + > + </solid-display> + </div> + </div> + </div> + `; + + render += ` + </div>`; + + return render; + } + + + viewCommunityFollowRequestAdd() { + let render = ` + <div class="segment block margin-right-xxsmall margin-left-xxsmall sm-margin-none padding-top-none sm-padding-xsmall"> + <div class="segment block sm-hidden text-left"> + <a class="backlink text-xlarge line-xlarge margin-right-xxsmall" href="javascript:history.back();">Retour</a> + </div> + + <div class="segment full padding-xsmall whitespace-normal"> + <div class="loader" id="loader-${this.route}-tzcld-add-exchange"> + <div></div> + <div></div> + <div></div> + <div></div> + </div> + <solid-form + fields="segment1(segment2(title(title_prefix), longdesc)), visible" + class="segment block whitespace-normal form" + class-visible="hidden" + value-visible="admins" + class-segment1="segment bg-color-white shadow border-rounded-xxsmall full text-top whitespace-normal" + 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" + 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 note" + label-longdesc="Contenu de la note :" + class-longdesc="segment margin-bottom-medium full sm-full padding-right-small sm-padding-none text-small text-semibold text-color-heading whitespace-normal text-xlarge" + widget-longdesc="solid-form-richtext-label" + loader-id="loader-${this.route}-tzcld-add-exchange" + bind-resources="" + nested-field="tzcld_community_shared_notes" + solid-resource="" + patrtial + submit-button="Enregistrer" + submit-widget="button" + class-submit-button="submit-button segment sm-full margin-top-xsmall text-xsmall children-link-button children-link-text-bold children-link-text-uppercase children-link-reversed color-secondary bordered children-button-icon children-icon-rocket children-icon-small children-icon-margin-right-xsmall" + > + </solid-form> + </div> + `; + + render += ` + </div>`; + + return render; + } + template(props) { this.uniq = props.uniq || utils.uniq(); @@ -918,7 +1064,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 padding-right-small sidebar-is-closed"> @@ -971,6 +1117,14 @@ import("./utils.js").then((utils) => { <div id="${utils.TZCLD_URLS.my_territory_follow}" data-view="${utils.TZCLD_URLS.my_territory_follow}" class="community-answers" hidden> ${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.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.viewCommunityFollowRequestAdd()} + </div> </div> ${this.viewRightMenu()}