mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
move _insert_vue_address include template in main, make it more generic
because it is used with person and household, but prepare to extend for thirdparty
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
{#
|
||||
This Twig template include load vue_address component.
|
||||
It push all variables from context in Address/App.vue.
|
||||
|
||||
OPTIONS
|
||||
* targetEntity {
|
||||
name: string
|
||||
id: integer
|
||||
}
|
||||
* mode string ['edit*'|'create']
|
||||
* addressId 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 = '{{ targetEntity.name|e('js') }}';
|
||||
window.entityId = '{{ targetEntity.id|e('js') }}';
|
||||
|
||||
{% if 'edit' in app.request.get('_route') %}
|
||||
window.mode = 'edit';
|
||||
window.addressId = {{ app.request.get('address_id')|e('js') }};
|
||||
{% elseif mode is defined and mode == 'edit' %}
|
||||
window.mode = 'edit';
|
||||
window.addressId = {{ addressId|e('js') }};
|
||||
{% endif %}
|
||||
|
||||
{% if backUrl is defined %}
|
||||
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') }}
|
Reference in New Issue
Block a user