{% extends '@kohinos/common/layout.html.twig' %}

{% form_theme form _self %}

{% block captcha_widget %}
	{% if is_human %}
	-
	{% else %}
		{% apply spaceless %}
			<div class='w-100 text-center mb-2'>
			    <img class="captcha_image d-inline-block" id="{{ image_id }}" src="{{ captcha_code }}" alt="" title="captcha" width="{{ captcha_width }}" height="{{ captcha_height }}" />
			</div>
		    {% if reload %}
		    <script type="text/javascript">
		        function reload_{{ image_id }}() {
		            var img = document.getElementById('{{ image_id }}');
		            img.src = '{{ captcha_code }}?n=' + (new Date()).getTime();
		        }
		    </script>
		    <a class="captcha_reload" href="javascript:reload_{{ image_id }}();">{{ 'Renew'|trans({}, 'gregwar_captcha') }}</a>
		    {% endif %}

		    {{ form_widget(form) }}
		{% endapply %}
	{% endif %}
{% endblock %}


{% block content %}
	<div class='container homepage'>
		{% include '@kohinos/block/breadcrumb.html.twig' with {'label' : 'Contact'} %}
		<div class="card mx-auto mt-2" style="max-width:800px;">
			<div class="card-header">{{ 'Nous contacter'|trans }}</div>
			<div class="card-body">
				<div class="mx-auto text-center" style="max-width:400px;">
					{{form_start(form)}}
					    {% if form.type is defined %}{{ form_row(form.type) }}{% endif %}
						{{ form_row(form.nom) }}
						{{ form_row(form.email) }}
						{{ form_row(form.message) }}
						{{ form_row(form.captcha) }}
						{{ form_row(form.save) }}
					{{form_end(form)}}
					{% if KOH_CONTACT_FORM_PHONE_NUMBER|default('') != '' %}
						<p style="margin-top: 30px;">Vous pouvez aussi nous contacter au {{KOH_CONTACT_FORM_PHONE_NUMBER}}</p>
					{% endif %}
		 		</div>
		 	</div>
		</div>
	</div>
{% endblock %}