diff --git a/src/index.js b/src/index.js index a06ea16ed5cccbe7a346662c2ecb9768230011c2..8246bc214ce0452aa6950d0974b5bba6cd4fc7d6 100644 --- a/src/index.js +++ b/src/index.js @@ -10,6 +10,7 @@ import('./utils.js').then(utils => { core.Helpers.importCSS(utils.path() + '/styles/territory-profile.css?min'); core.Helpers.importCSS(utils.path() + '/styles/territory-list.css?min'); core.Helpers.importCSS(utils.path() + '/styles/evaluations.css?min'); + core.Helpers.importCSS(utils.path() + '/styles/shared-notes.css?min'); core.Helpers.importCSS(utils.path() + '/styles/tzcld-icons.css?min'); 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/styles/shared-notes.scss b/src/styles/shared-notes.scss new file mode 100644 index 0000000000000000000000000000000000000000..c37bc8c27b05f1d6d9ccc0ecff7f625f34f2d974 --- /dev/null +++ b/src/styles/shared-notes.scss @@ -0,0 +1,132 @@ +.community-exchanges { + + &.home { + .last-note { + vertical-align: top; + nav { + display: none; + } + .button.button.reversed.color-secondary { + margin: 10px 20px 10px 0; + } + } + + + } + + &.one { + [type="submit"] { + background: var(--color-primary); + border: 2px solid var(--color-primary); + border-radius: 4px; + color: #fff; + display: inline-block; + font-size: 12px; + font-weight: 700; + margin: 10px 0 10px auto; + padding: 8px 12px; + text-align: center; + text-transform: uppercase; + + &:hover { + color: var(--color-primary); + background: #fff; + } + } + textarea { + display: block; + background: #f6f6f6; + border: none; + outline: none; + color: #636363; + padding: 12px 14px; + margin-top: 5px; + line-height: 1; + height: 46px; + width: 100%; + box-sizing: border-box; + height: 110px; + resize: vertical; + } + .conversation-form { + background: #fff; + border-radius: 5px; + box-shadow: 0 0 6px 0 rgba(46,63,88,.14); + border: none; + padding: 10px 20px; + form{ + label { + font-size: 16px; + line-height: 18px; + color: var(--color-heading); + font-weight: 600; + padding-top: 10px; + } + &>div { + text-align: right; + } + } + } + .solid-conversation { + .conversation-item { + background: #fff; + border-radius: 5px; + box-shadow: 0 0 6px 0 rgba(46,63,88,.14); + border: none; + padding: 10px 20px; + margin: 1rem 0; + + [name="author.name"] { + color: var(--color-heading); + } + } + } + } + + [name="counter"] { + &>div { + padding-right: 30px; + } + + .link { + text-transform: uppercase; + padding: 12px; + display: inline-block; + } + } + .view-display { + position: absolute; + right: 20px; + top: 20px; + z-index: 1; + } + + .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; + } + } + } + form [data-richtext]>.ql-editor { + /*min-height: 200px;*/ + } + + + solid-display-value-markdown p { + margin: 0 0 10px 0; + } + 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..0c3acda847743d624fe01e04f15cc40198e6bd04 100644 --- a/src/utils.js +++ b/src/utils.js @@ -6,6 +6,12 @@ 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', + my_territory_all_exchanges: 'tzcld-tous-les-echnages', + my_territory_add_exchange: 'tzcld-add-echnage', + my_territory_exchange_space: 'tzcld-echnage-space', + my_territory_exchange: 'tzcld-echnage', + my_territory_edit_exchange: 'tzcld-edit-echnage', } export function path() { diff --git a/src/views-terrytories.js b/src/views-terrytories.js index 37f0311530bf51207ad040036d25b06e64789e7c..79e41802e1867c82bad0c13a5fd2d0827ecd8961 100644 --- a/src/views-terrytories.js +++ b/src/views-terrytories.js @@ -28,19 +28,73 @@ import("./utils.js").then((utils) => { territoriesStepStates: "territories-step-states", territoriesOriginsMobilisation: "territories-origins-mobilisation", apiUrl: "api-url", + xmpp: "xmpp", }; } routeurs() { let render = ` <solid-router default-route="${utils.TZCLD_URLS.my_territories}" route-prefix="tzcld"> - <solid-route name="${utils.TZCLD_URLS.my_territory_space}" use-id></solid-route> <solid-route name="${utils.TZCLD_URLS.my_territories}"></solid-route> + <solid-route name="${utils.TZCLD_URLS.my_territory_space}" 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="${utils.TZCLD_URLS.my_territory_infos}"> + <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> + <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> + </ul> + </solid-router> + </nav>`; + return render; + } + viewWidgets() { let render = ` @@ -136,7 +190,69 @@ 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-orbit-shared-note-actions"> + <template> + <solid-ac-checker permission="acl:Write" data-src="\${value}"> + <solid-link class="icon icon-pencil" data-src="\${value}" next="${utils.TZCLD_URLS.my_territory_edit_exchange}"></solid-link> + </solid-ac-checker> + </template> + </solid-widget> + + <solid-widget name="tzcld-exchanges-conversations-counter"> + <template> + <div class="text-right"> + <span class="link margin-right-small"><solid-display fields="" data-src="\${src || value}" nested-field="conversations" counter-template="\\\${counter}"></solid-display> + <span class="">Commentaires</span> + </span> + <solid-link class="icon icon-speech link" data-src="\${src || value}" next="${utils.TZCLD_URLS.my_territory_exchange}"> Commenter</solid-link> + </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> + + <solid-widget name="tzcld-exchanges-conversations-feed"> + <template> + <h3 class="text-color-heading text-semibold text-letter-spacing-large">Commentaires</h3> + <solid-conversation + data-src="\${value}" + send-button-text="Ajouter le commentaire" + solid-resource="" + > + </solid-conversation> + </template> + </solid-widget> `; return render; } @@ -170,6 +286,269 @@ import("./utils.js").then((utils) => { return render; } + viewExchanges() { + let render = ` + <h2 class="text-color-heading text-bold text-xxxlarge text-letter-spacing-large margin-top-none padding-left-xsmall">Échanges avec mes référent-es</h2> + <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 last-note"> + <h2 class="tzcld-h2">Notes partagées</h2> + <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)), @id" + 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-none 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="solid-display-value-markdown" + value-title_prefix="Note du " + label-user.name="De " + loader-id="loader-${this.route}-tzcld-exchanges" + widget-id="tzcld-orbit-shared-note-actions" + class-id="view-display children-link-rounded children-link-reversed color-primary bordered" + bind-resources="" + nested-field="tzcld_community_shared_notes" + action-counter="counter" + widget-counter="tzcld-exchanges-conversations-counter" + solid-resource="" + order-desc="@id" + paginate-by="1" + next="${utils.TZCLD_URLS.my_territory_exchange}" + > + </solid-display> + <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_all_exchanges}">Voir toutes les notes</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_add_exchange}">Ajouter une note</solid-link></p> + </div> + <div class="segment third padding-xsmall whitespace-normal list-referents"> + <h2 class="tzcld-h2">Mes référent-es</h2> + <solid-display + bind-resources="" + nested-field="tzcld_profile.regions" + fields="referents" + widget-referents="tzcld-regions-referent-jobs" + > + </solid-display> + </div> + `; + + render += ` + </div>`; + + return render; + } + + viewAllExchanges() { + 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> + + <p class="text-right padding-xsmall"><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_add_exchange}">Ajouter une note</solid-link></p> + <div class="segment block padding-xsmall whitespace-normal"> + <div class="loader" id="loader-${this.route}-tzcld-all-exchanges"> + <div></div> + <div></div> + <div></div> + <div></div> + </div> + <solid-display + fields="segment1(segment2(title(title_prefix, date), user.name, longdesc), segment3(counter)), @id" + class="segment block whitespace-normal pagination children children-full padding-right-large" + class-segment1="segment hover bg-color-white shadow border-rounded-xxsmall full text-top whitespace-normal cursor-pointer margin-bottom-small" + class-segment2="segment block padding-xlarge text-left" + class-segment3="segment block padding-none 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="solid-display-value-markdown" + value-title_prefix="Note du " + label-user.name="De " + loader-id="loader-${this.route}-tzcld-all-exchanges" + widget-id="tzcld-orbit-shared-note-actions" + class-id="view-display children-link-rounded children-link-reversed color-primary bordered" + bind-resources="" + nested-field="tzcld_community_shared_notes" + action-counter="counter" + widget-counter="tzcld-exchanges-conversations-counter" + solid-resource="" + order-desc="@id" + paginate-by="10" + next="${utils.TZCLD_URLS.my_territory_exchange}" + > + </solid-display> + </div> + `; + + render += ` + </div>`; + + return render; + } + + + viewAddExchange() { + 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; + } + + viewEditExchange() { + 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-edit-exchange"> + <div></div> + <div></div> + <div></div> + <div></div> + </div> + <solid-form + fields="segment1(segment2(title(title_prefix), longdesc))" + class="segment block whitespace-normal form" + 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" + widget-title_prefix="span" + value-title_prefix="Modification de la note" + class-title="margin-bottom-large margin-top-none margin-left-none text-xlarge text-xbold text-color-heading text-color-dark-blue" + label-longdesc="Contenu de la note :" + widget-longdesc-old="solid-form-textarea-label" + 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-edit-exchange" + bind-resources="" + 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; + } + + viewExchange() { + 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 block padding-xsmall whitespace-normal"> + <div class="loader" id="loader-${this.route}-tzcld-exchange"> + <div></div> + <div></div> + <div></div> + <div></div> + </div> + <solid-display + fields="segment1(segment2(title(title_prefix, date), user.name, longdesc)), @id" + class="segment block whitespace-normal" + 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" + widget-title_prefix="span" + widget-date="tzcld-format-date-1" + widget-longdesc="solid-display-value-markdown" + value-title_prefix="Note du " + label-user.name="De " + loader-id="loader-${this.route}-tzcld-exchange" + widget-id="tzcld-orbit-shared-note-actions" + class-id="view-display children-link-rounded children-link-reversed color-primary bordered" + bind-resources="" + solid-resource="" + > + </solid-display> + </div> + <div class="segment block padding-xsmall sm-padding-xsmall sm-padding-top-normal whitespace-normal bg-color-grey wrapper-resource-comments"> + <div class="segment full sm-full"> + + <div class="loader" id="loader-${this.route}-tzcld-exchange-conversations-feed"> + <div></div> + <div></div> + <div></div> + <div></div> + </div> + <solid-display + fields="conversations" + class="segment block whitespace-normal" + widget-conversations="tzcld-exchanges-conversations-feed" + loader-id="loader-${this.route}-tzcld-exchange-conversations-feed" + bind-resources="" + solid-resource="" + > + </solid-display> + </div> + </div> + `; + + render += ` + </div>`; + + return render; + } + viewMyCommunities() { let render = ` <div id="${utils.TZCLD_URLS.my_territories}" data-view="${utils.TZCLD_URLS.my_territories}" class="tzcld-my-communities"> @@ -239,46 +618,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="${utils.TZCLD_URLS.my_territory_infos}" > - <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() { @@ -545,6 +884,7 @@ import("./utils.js").then((utils) => { this.territoriesStepStates = props.territoriesStapeStates ; this.territoriesOriginsMobilisation = props.territoriesOriginsMobilisationn ; this.apiUrl = props.apiUrl ; + this.xmpp = props.xmpp ; //console.table(props); @@ -555,7 +895,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"> @@ -563,6 +903,44 @@ 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 home" hidden> + ${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_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_exchange_space}" data-view="${utils.TZCLD_URLS.my_territory_exchange_space}" class="community-exchanges one" hidden> + + <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> + <solid-route name="${utils.TZCLD_URLS.my_territory_edit_exchange}" use-id></solid-route> + </solid-router> + + + <div id="my_territory_all_exchanges_empty" data-view="my_territory_all_exchanges_empty" class="community-exchanges one" hidden> + + </div> + + <div id="${utils.TZCLD_URLS.my_territory_exchange}" data-view="${utils.TZCLD_URLS.my_territory_exchange}" class="community-exchanges one" hidden> + ${this.viewExchange()} + </div> + + <div id="${utils.TZCLD_URLS.my_territory_edit_exchange}" data-view="${utils.TZCLD_URLS.my_territory_edit_exchange}" class="community-exchanges edit" hidden> + ${this.viewEditExchange()} + </div> + + + + </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; }, });