diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue index 42fe1a867..3e2d8ab97 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue @@ -10,9 +10,9 @@ {{ $t('renderbox.type.thirdparty')}} - - - + + + - - + + + @@ -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 + } */ } } diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/views/Entity/thirdparty.html.twig b/src/Bundle/ChillThirdPartyBundle/Resources/views/Entity/thirdparty.html.twig index 3bd97579e..4f1e739a8 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/views/Entity/thirdparty.html.twig +++ b/src/Bundle/ChillThirdPartyBundle/Resources/views/Entity/thirdparty.html.twig @@ -84,18 +84,15 @@ {{ _self.label(thirdparty, options) }} {% if thirdparty.kind == 'child' %} - - {{ 'thirdparty.child'|trans }} + {{ 'thirdparty.child'|trans }} {% elseif thirdparty.kind == 'company' %} - - {{ 'thirdparty.company'|trans }} + {{ 'thirdparty.company'|trans }} {% else %} - - {{ 'thirdparty.contact'|trans }} + {{ 'thirdparty.contact'|trans }} {% endif %} @@ -175,26 +172,33 @@ {% if options['showContacts'] and thirdparty.activeChildren|length > 0 %}
- {{ 'thirdparty.Children'|trans }} : - {% for c in thirdparty.activeChildren %} - {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { - targetEntity: { name: 'thirdparty', id: c.id }, - action: 'show', - displayBadge: true, - buttonText: c|chill_entity_render_string - } %} - {% endfor %} +
+
+
{{ 'thirdparty.Children'|trans ~ ': ' }}
+ {% for c in thirdparty.activeChildren %} + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + targetEntity: { name: 'thirdparty', id: c.id }, + action: 'show', + displayBadge: true, + buttonText: c|chill_entity_render_string + } %} + {% endfor %} +
{% endif %} + {% if options['showParent'] and thirdparty.isChild %}
- {{ 'thirdparty.Contact of'|trans }} : - {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { - targetEntity: { name: 'thirdparty', id: thirdparty.parent.id }, - action: 'show', - displayBadge: true, - buttonText: thirdparty.parent|chill_entity_render_string - } %} +
+
+
{{ 'thirdparty.Contact of'|trans ~ ': ' }}
+ {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + targetEntity: { name: 'thirdparty', id: thirdparty.parent.id }, + action: 'show', + displayBadge: true, + buttonText: thirdparty.parent|chill_entity_render_string + } %} +
{% endif %}