mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
twig pass arguments to vue_address with dataset attributes
This commit is contained in:
@@ -14,54 +14,51 @@
|
||||
* buttonText twig translated chain
|
||||
* buttonSize bootstrap class like 'btn-sm'
|
||||
* buttonDisplayText bool
|
||||
* binModalStep1 bool
|
||||
* binModalStep2 bool
|
||||
* bindModalStep1 bool
|
||||
* bindModalStep2 bool
|
||||
|
||||
#}
|
||||
<div id="address"></div>
|
||||
<div class="address-container"
|
||||
|
||||
<script type="text/javascript">
|
||||
window.vueRootComponent = 'app';
|
||||
|
||||
window.entityType = '{{ targetEntity.name|e('js') }}';
|
||||
window.entityId = '{{ targetEntity.id|e('js') }}';
|
||||
data-target-entity-name="{{ targetEntity.name|e('html_attr') }}"
|
||||
data-target-entity-id="{{ targetEntity.id|e('html_attr') }}"
|
||||
|
||||
{% if 'edit' in app.request.get('_route') %}
|
||||
window.mode = 'edit';
|
||||
window.addressId = {{ app.request.get('address_id')|e('js') }};
|
||||
data-mode="edit"
|
||||
data-address-id="{{ app.request.get('address_id')|e('html_attr') }}"
|
||||
{% elseif mode is defined and mode == 'edit' %}
|
||||
window.mode = 'edit';
|
||||
window.addressId = {{ addressId|e('js') }};
|
||||
data-mode="edit"
|
||||
data-address-id="{{ addressId|e('html_attr') }}"
|
||||
{% endif %}
|
||||
|
||||
{% if backUrl is defined %}
|
||||
window.backUrl = '{{ backUrl|e('js') }}';
|
||||
data-back-url="{{ backUrl|e('html_attr') }}"
|
||||
{% endif %}
|
||||
|
||||
{% if modalTitle is defined %}
|
||||
window.modalTitle = '{{ modalTitle|trans|e('js') }}';
|
||||
data-modal-title="{{ modalTitle|trans|e('html_attr') }}"
|
||||
{% endif %}
|
||||
|
||||
{% if buttonText is defined %}
|
||||
window.buttonText = '{{ buttonText|trans|e('js') }}';
|
||||
data-button-text="{{ buttonText|trans|e('html_attr') }}"
|
||||
{% endif %}
|
||||
|
||||
{% if buttonSize is defined %}
|
||||
window.buttonSize = '{{ buttonSize|e('js') }}';
|
||||
data-button-size="{{ buttonSize|e('html_attr') }}"
|
||||
{% endif %}
|
||||
|
||||
{% if buttonDisplayText is defined and buttonDisplayText == false %}
|
||||
window.buttonDisplayText = false;
|
||||
data-button-display-text=false
|
||||
{% endif %}
|
||||
|
||||
{% if binModalStep1 is defined and binModalStep1 == false %}
|
||||
window.binModalStep1 = false;
|
||||
{% if bindModalStep1 is defined and bindModalStep1 == false %}
|
||||
data-bind-modal-step1=false
|
||||
{% endif %}
|
||||
|
||||
{% if binModalStep2 is defined and binModalStep2 == false %}
|
||||
window.binModalStep2 = false;
|
||||
{% if bindModalStep2 is defined and bindModalStep2 == false %}
|
||||
data-bind-modal-step2=false
|
||||
{% endif %}
|
||||
</script>
|
||||
></div>
|
||||
|
||||
{{ encore_entry_script_tags('vue_address') }}
|
||||
{{ encore_entry_link_tags('vue_address') }}
|
||||
|
Reference in New Issue
Block a user