tp form: call vue_address to manage address, wip

show some limits with AddAddress:
* bug with option buttonText overriding default
* need to improve step1
This commit is contained in:
2021-09-15 12:57:37 +02:00
parent 92fae5cba2
commit e94790b8ab
4 changed files with 134 additions and 2 deletions

View File

@@ -0,0 +1,77 @@
{#
This Twig template include load vue_address component.
It push all variables from context in Address/App.vue.
OPTIONS
* mode string ['edit*'|'new'|'create']
* address_id integer
* backUrl twig route: path('route', {parameters})
* modalTitle twig translated chain
* buttonText twig translated chain
* buttonSize bootstrap class like 'btn-sm'
* buttonDisplayText bool
* binModalStep1 bool
* binModalStep2 bool
#}
<div id="address"></div>
<script type="text/javascript">
window.vueRootComponent = 'app';
window.entityType = 'thirdParty';
window.entityId = {{ thirdParty.id|e('js') }};
{% if 'edit' in app.request.get('_route') %}
window.addressId = {{ app.request.get('address_id')|e('js') }};
window.mode = 'edit';
{% elseif mode is defined and mode == 'edit' %}
window.addressId = {{ address_id|e('js') }};
window.mode = 'edit';
{% endif %}
{% if backUrl is not defined %}
window.backUrl = '{{ path('chill_3party_3party_show', { 'thirdparty_id': thirdParty.id })|e('js') }}';
{% else %}
window.backUrl = '{{ backUrl|e('js') }}';
{% endif %}
{% if modalTitle is defined %}
window.modalTitle = '{{ modalTitle|trans|e('js') }}';
{% endif %}
{% if buttonText is defined %}
window.buttonText = '{{ buttonText|trans|e('js') }}';
{% endif %}
{% if buttonSize is defined %}
window.buttonSize = '{{ buttonSize|e('js') }}';
{% endif %}
{% if buttonDisplayText is defined and buttonDisplayText == false %}
window.buttonDisplayText = false;
{% endif %}
{% if binModalStep1 is defined and binModalStep1 == false %}
window.binModalStep1 = false;
{% endif %}
{% if binModalStep2 is defined and binModalStep2 == false %}
window.binModalStep2 = false;
{% endif %}
</script>
{{ encore_entry_script_tags('vue_address') }}
{{ encore_entry_link_tags('vue_address') }}
{# TODO
* un seul fichier include twig qui fais la liaison avec vue_address
* dans main
* enlever les références à household, person, thirdparty
* addAddress
* option buttonText est buggée
* gestion du step1
*
#}