mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 00:23:50 +00:00
thirdparty: improve render for children/parent dependencies in renderbox vue/twig
This commit is contained in:
@@ -22,12 +22,6 @@
|
||||
</badge-entity>
|
||||
</div>
|
||||
|
||||
<div v-if="hasParent">
|
||||
<span class="name tparty-parent">
|
||||
> {{ thirdparty.parent.text }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<p v-if="this.options.addInfo === true" class="moreinfo">
|
||||
</p>
|
||||
</div>
|
||||
@@ -56,21 +50,47 @@
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</confidential>
|
||||
<ul v-else class="list-content fa-ul">
|
||||
<li v-if="thirdparty.address">
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
<address-render-box :address="thirdparty.address" :isMultiline="isMultiline"></address-render-box>
|
||||
</li>
|
||||
<li v-if="thirdparty.phonenumber">
|
||||
<i class="fa fa-li fa-mobile"></i>
|
||||
<a :href="'tel: ' + thirdparty.phonenumber">{{ thirdparty.phonenumber }}</a>
|
||||
</li>
|
||||
<li v-if="thirdparty.email">
|
||||
<i class="fa fa-li fa-envelope-o"></i>
|
||||
<a :href="'mailto: ' + thirdparty.email">{{ thirdparty.email }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</confidential>
|
||||
<ul v-else class="list-content fa-ul">
|
||||
<li v-if="thirdparty.address">
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
<address-render-box :address="thirdparty.address" :isMultiline="isMultiline"></address-render-box>
|
||||
</li>
|
||||
<li v-if="thirdparty.phonenumber">
|
||||
<i class="fa fa-li fa-mobile"></i>
|
||||
<a :href="'tel: ' + thirdparty.phonenumber">{{ thirdparty.phonenumber }}</a>
|
||||
</li>
|
||||
<li v-if="thirdparty.email">
|
||||
<i class="fa fa-li fa-envelope-o"></i>
|
||||
<a :href="'mailto: ' + thirdparty.email">{{ thirdparty.email }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="list-content fa-ul">
|
||||
<li v-if="hasParent">
|
||||
<i class="fa fa-li fa-hand-o-right"></i>
|
||||
<b class="me-2">{{ $t('child_of') }}</b>
|
||||
<span class="chill-entity badge-thirdparty">{{ thirdparty.parent.text }}</span>
|
||||
<!-- console: [Vue warn]: Failed to resolve component: on-the-fly ...
|
||||
<on-the-fly type="thirdparty" action="show" :id="thirdparty.parent.id"
|
||||
:buttonText="thirdparty.parent.text" :displayBadge="'true' === 'true'"
|
||||
></on-the-fly>
|
||||
-->
|
||||
</li>
|
||||
<!-- TODO hasChildren
|
||||
<li v-if="hasChildren">
|
||||
<i class="fa fa-li fa-hand-o-right"></i>
|
||||
<b class="me-2">{{ $t('children') }}</b>
|
||||
<span v-for="child in thirdparty.activeChildren">
|
||||
<on-the-fly type="thirdparty"
|
||||
action="show"
|
||||
:id="child.id"
|
||||
:buttonText="child.text"
|
||||
displayBadge="'true' === 'true'">
|
||||
</on-the-fly>
|
||||
</span>
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -86,13 +106,22 @@ import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRe
|
||||
import {dateToISO} from 'ChillMainAssets/chill/js/date.js';
|
||||
import Confidential from 'ChillMainAssets/vuejs/_components/Confidential.vue';
|
||||
import BadgeEntity from 'ChillMainAssets/vuejs/_components/BadgeEntity.vue';
|
||||
//import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
|
||||
|
||||
export default {
|
||||
name: "ThirdPartyRenderBox",
|
||||
components: {
|
||||
AddressRenderBox,
|
||||
Confidential,
|
||||
BadgeEntity
|
||||
BadgeEntity,
|
||||
//OnTheFly
|
||||
},
|
||||
i18n: {
|
||||
messages: {
|
||||
fr: {
|
||||
children: "Personnes de contact: ",
|
||||
child_of: "Contact de: ",
|
||||
}}
|
||||
},
|
||||
props: ['thirdparty', 'options'],
|
||||
computed: {
|
||||
@@ -104,8 +133,13 @@ export default {
|
||||
}
|
||||
},
|
||||
hasParent() {
|
||||
return !(this.$props.thirdparty.parent === null || this.$props.thirdparty.parent === undefined);
|
||||
}
|
||||
return !(this.thirdparty.parent === null || this.thirdparty.parent === undefined);
|
||||
},
|
||||
/* TODO need backend normalizer to serve children without circular reference
|
||||
hasChildren() {
|
||||
//console.log(this.thirdparty.activeChildren.length > 0)
|
||||
return false
|
||||
} */
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user