mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
thirdparty: improve render for children/parent dependencies in renderbox vue/twig
This commit is contained in:
parent
5b321dfb81
commit
5fdbba9ef5
@ -10,9 +10,9 @@
|
||||
{{ $t('renderbox.type.thirdparty')}}
|
||||
</template>
|
||||
|
||||
<i class="fa fa-user fa-fw" v-if="entity.kind === 'child'"></i>
|
||||
<i class="fa fa-hospital-o fa-fw" v-else-if="entity.kind === 'company'"></i>
|
||||
<i class="fa fa-user-md fa-fw" v-else></i>
|
||||
<i class="fa fa-fw fa-user" v-if="entity.kind === 'child'"></i>
|
||||
<i class="fa fa-fw fa-hospital-o" v-else-if="entity.kind === 'company'"></i>
|
||||
<i class="fa fa-fw fa-user-md" v-else></i>
|
||||
|
||||
<template v-if="options.displayLong === true">
|
||||
<span v-if="entity.kind === 'child'">{{ $t('tparty.child')}}</span>
|
||||
|
@ -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>
|
||||
@ -71,6 +65,32 @@
|
||||
<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>
|
||||
|
@ -84,18 +84,15 @@
|
||||
{{ _self.label(thirdparty, options) }}
|
||||
{% if thirdparty.kind == 'child' %}
|
||||
<span class="badge rounded-pill bg-thirdparty">
|
||||
<i class="fa fa-user fa-fw"></i>
|
||||
{{ 'thirdparty.child'|trans }}
|
||||
<i class="fa fa-fw fa-user"></i>{{ 'thirdparty.child'|trans }}
|
||||
</span>
|
||||
{% elseif thirdparty.kind == 'company' %}
|
||||
<span class="badge rounded-pill bg-thirdparty">
|
||||
<i class="fa fa-hospital-o fa-fw"></i>
|
||||
{{ 'thirdparty.company'|trans }}
|
||||
<i class="fa fa-fw fa-hospital-o"></i>{{ 'thirdparty.company'|trans }}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="badge rounded-pill bg-thirdparty">
|
||||
<i class="fa fa-user-md fa-fw"></i>
|
||||
{{ 'thirdparty.contact'|trans }}
|
||||
<i class="fa fa-fw fa-user-md"></i>{{ 'thirdparty.contact'|trans }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
@ -175,7 +172,9 @@
|
||||
</div>
|
||||
{% if options['showContacts'] and thirdparty.activeChildren|length > 0 %}
|
||||
<div class="item-row">
|
||||
{{ 'thirdparty.Children'|trans }} :
|
||||
<div class="item-col"></div>
|
||||
<div class="item-col">
|
||||
<h5 class="me-2">{{ 'thirdparty.Children'|trans ~ ': ' }}</h5>
|
||||
{% for c in thirdparty.activeChildren %}
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
targetEntity: { name: 'thirdparty', id: c.id },
|
||||
@ -185,10 +184,14 @@
|
||||
} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if options['showParent'] and thirdparty.isChild %}
|
||||
<div class="item-row">
|
||||
{{ 'thirdparty.Contact of'|trans }} :
|
||||
<div class="item-col"></div>
|
||||
<div class="item-col">
|
||||
<h5 class="me-2">{{ 'thirdparty.Contact of'|trans ~ ': ' }}</h5>
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
targetEntity: { name: 'thirdparty', id: thirdparty.parent.id },
|
||||
action: 'show',
|
||||
@ -196,6 +199,7 @@
|
||||
buttonText: thirdparty.parent|chill_entity_render_string
|
||||
} %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{%- endif -%}
|
||||
|
Loading…
x
Reference in New Issue
Block a user