{# configuration example
###########
col: 12
enabled: false
title:
enabled: true
type: h3
class: text-light
content: Hotline
wrapper:
class: ''
class: 'col-md-4 align-self-center mt-3'
name:
enabled: true
class: text-uppercase
override_content: 'Vous avez une question ?'
email:
enabled: true
class: text-light
form_only: true
override_content: ''
phone:
enabled: true
class: text-light
override_content: ''
#}
{% if componentKey is not defined %}
{% set componentKey = "contact_infos" %}
{% endif %}
{% set item_config = generateComponentOptions(value, componentKey) %}
{% if canDisplayComponentByAcl(item_config) %}
<div data-component-acl="{{ componentKey }}" class="{% if item_config.wrapper.class is defined %}{{ item_config.wrapper.class }}{% endif %}">
{% embed '@component/_template/_atom_wrapper.html.twig' with {value: value.title, atom_key: componentKey ~ '.title'} %}
{% block atom %}
{% include'@component/atom/title.html.twig' with {'title': value} %}
{% endblock atom %}
{% endembed %}
{% embed '@component/_template/_atom_wrapper.html.twig' with {value: value.name, atom_key: componentKey ~ '.name'} %}
{% block atom %}
<p {% if value.class is defined %}class="{{ value.class }}"{% endif %}>
{% if value.override_content is defined and value.override_content not in [null, ''] %}
{{ value.override_content|trans|raw }}
{% else %}
{{ platform_global('hotline.name') }}
{% endif %}
</p>
{% endblock atom %}
{% endembed %}
{% embed '@component/_template/_atom_wrapper.html.twig' with {value: value.email, atom_key: componentKey ~ '.email'} %}
{% block atom %}
<div class="{% if value.class is defined %}{{ value.class }}{% endif %}">
{% if value.override_content is defined and value.override_content not in [null, ''] %}
{{ value.override_content|raw }}
{% elseif (platform_global('hotline.contact_form_only') is not same as(false) ) %}
{% if app.user is not same as(null) and app.request.get('_route') is not same as('front_contact_show') %}
<a href="{{ path('front_contact_show') }}" class="{{ value.class }} capitalize-first-word">
{{ 'formulaire de contact'|trans|capitalize }}
</a>
{% elseif app.request.get('_route') in getAclConstantByKey('ACL_SECURITY_ROUTES') %}
{% set email = platform_global('hotline.email.contact') %}
{% if value.enabled and value.override_content not in ['', null] %}
{% set email = value.override_content %}
{% endif %}
<a class="{{ value.class }}" href="mailto:{{ email }}">
{{ email }}
</a>
{% else %}
<p class="{{ value.class }} capitalize-first-word">{{ 'formulaire de contact'|trans }}</p>
{% endif %}
{% if value.phone.enabled is defined and value.phone.enabled is same as(true) %}
<p>
{{ platform_global('hotline.phone.calendar.days')|trans }} <br>
{{ platform_global('hotline.phone.calendar.hours')|trans }}
</p>
{% endif %}
{% else %}
<a class="{{ value.class }}" href="mailto:{{ platform_global('hotline.email.contact') }}">
{{ platform_global('hotline.email.contact') }}
</a>
{% endif %}
</div>
{% endblock atom %}
{% endembed %}
{% if value.end_item is defined %}
{% include '@component/molecule/footer_signature.html.twig' with {'value': value.end_item, componentKey: componentKey ~ '.end_item'} %}
{% endif %}
</div>
{% endif %}