{% extends "page/titled/default.html.twig" %}

{% block body %}
    <div class="col-12">
        <div class="body">
            <div class="body-content prose-lg">
                {{- _page.content.value|murph_url|markdown('post') -}}
            </div>
        </div>
    </div>

    {% if showForm %}
        <div class="body">
            <form class="form grid grid-flow-row-dens grid-cols-2 gap-5" method="POST" data-form-bot action="{{ safe_url('blog_tech_form_without_javascript', {page: app.request.uri, _domain: _domain}) }}">
                <div class="col-span-2 md:col-span-1">
                    {{ form_label(form.name, null, {label_attr: {class: 'label'}}) }}
                    {{ form_widget(form.name, {attr: {class: 'input input-bordered w-full'}}) }}
                    {{ form_errors(form.name) }}
                </div>
                <div class="col-span-2 md:col-span-1">
                    {{ form_label(form.email, null, {label_attr: {class: 'label'}}) }}
                    {{ form_widget(form.email, {attr: {class: 'input input-bordered w-full'}}) }}
                    {{ form_errors(form.email) }}
                </div>
                <div class="col-span-2">
                    {{ form_label(form.subject, null, {label_attr: {class: 'label'}}) }}
                    {{ form_widget(form.subject, {attr: {class: 'input input-bordered w-full'}}) }}
                    {{ form_errors(form.subject) }}
                </div>
                <div class="col-span-2">
                    {{ form_label(form.message, null, {label_attr: {class: 'label'}}) }}
                    {{ form_errors(form.message) }}
                    {{ form_widget(form.message, {attr: {cols: 30, rows: 10, class: 'textarea textarea-bordered w-full'}}) }}
                </div>
                <div class="col-span-2">
                    <div class="md:flex justify-start gap-3">
                        {{ form_label(form.captcha, null, {label_attr: {class: 'label'}}) }}
                        {{ form_widget(form.captcha, {attr: {class: 'input input-bordered'}}) }}
                    </div>
                </div>
                <div class="col-span-2">
                    <label class="label justify-start gap-3" for="rgpd">
                        <input type="checkbox" id="rgpd" class="checkbox" required>
                        <span class="label">En validant ce formulaire, vous acceptez que j'utilise votre e-mail pour vous fournir une réponse.</span>
                    </label>
                </div>
                <div class="col-span-2">
                    <input type="submit" class="btn btn-primary" value="Envoyer" />
                </div>

                {{ form_rest(form) }}
            </form>
        </div>
    {% endif %}
{% endblock %}
