{% form_theme form 'app/_inc/fields.html.twig' %}
{% import 'app/_inc/macros.html.twig' as m %}
{% block css %}{{ encore_entry_link_tags('app-contact-css') }}{% endblock %}
{% extends 'base.html.twig' %}
{% block content %}
{{ m.title('Nous contacter', 'nav.contact', asset('img/planete-sablage-a-lyon-batiments-typiques.jpg')) }}
<main class="main-default contact-page">
<div class="container container-narrow">
<div class="contact-left">
<address>
<p>{{ website_name }}</p>
{{ coord.address|raw }}
<a class="tel" href="Tel:0778385352">{{ coord.phone }}</a> <br>
<a href="{{ coord.google }}" target="_blank">Plan d'accès</a>
</address>
</div>
<div class="contact-right">
<h2 class="h2">Nous contacter</h2>
{% for msg in app.flashes('contact.success') %}
<div class="alert alert-success">
{{ msg|trans }} <i class="fas fa-times"></i></a>
</div>
{% endfor %}
{% for msg in app.flashes('contact.error') %}
<div class="alert alert-danger">
{{ msg|trans }} <i class="fas fa-times"></i></a>
</div>
{% endfor %}
{{ form_start(form, {attr:{class:'form'}}) }}
{{ form_row(form.name) }}
{{ form_row(form.phone) }}
{{ form_row(form.email) }}
{{ form_row(form.message) }}
<br>
<input type="hidden" id="g-recaptcha-response" name="g-recaptcha-response">
<button aria-label="{{ 'all.send'|trans }}" title="{{ 'all.send'|trans }}" class="link">
<span>{{ 'all.send'|trans }}</span>
</button>
{{ form_end(form) }}
</div>
</div>
</main>
<script src="https://www.google.com/recaptcha/api.js?render={{ captcha_site_key }}"></script>
<script>
grecaptcha.ready(function () {
grecaptcha.execute('{{ captcha_site_key }}', {action: 'validate_captcha'})
.then(function (token) {
document.getElementById('g-recaptcha-response').value = token;
});
});
</script>
{% endblock %}