{% extends 'school/base.html.twig' %}

{% block title %}{{ title }} | SALSABIL Madrassas{% endblock %}

{% block content %}
    <div class="admin-page-stack">
        <section class="admin-page-header">
            <div>
                <p class="admin-eyebrow">SECTION</p>
                <h1 class="admin-page-title">{{ title }}</h1>
                <p>Décrivez un programme visible dans l’administration école et sur la page publique de la madrassa.</p>
            </div>
            <a class="admin-btn admin-btn-light" href="{{ path('school_section_index') }}">Retour aux sections</a>
        </section>

        {{ form_start(form, {attr: {class: 'admin-form'}}) }}
            <div class="admin-form-grid">
                <section class="admin-card admin-form-section">
                    <div class="admin-card-head">
                        <div>
                            <h2>Informations principales</h2>
                            <p>Nom, adresse courte et type de programme.</p>
                        </div>
                    </div>
                    <div class="admin-form-two-cols">
                        {{ form_row(form.nom) }}
                        {{ form_row(form.slug) }}
                    </div>
                    <div class="admin-form-two-cols">
                        {{ form_row(form.type) }}
                        {{ form_row(form.publicCible) }}
                    </div>
                    {{ form_row(form.description) }}
                </section>

                <section class="admin-card admin-form-section">
                    <div class="admin-card-head">
                        <div>
                            <h2>Publication</h2>
                            <p>L’ordre contrôle la priorité d’affichage sur la page publique.</p>
                        </div>
                    </div>
                    <div class="admin-form-two-cols">
                        {{ form_row(form.ordre) }}
                        <div class="admin-form-check admin-form-check-card">
                            {{ form_row(form.active) }}
                        </div>
                    </div>
                </section>

                <section class="admin-card admin-form-section">
                    <div class="admin-card-head">
                        <div>
                            <h2>Groupe WhatsApp</h2>
                            <p>Ces informations sont utilisées lors de la validation d’une inscription si aucune classe n’a de groupe dédié.</p>
                        </div>
                    </div>
                    <div class="admin-form-two-cols">
                        {{ form_row(form.whatsappGroupId) }}
                        {{ form_row(form.whatsappGroupInviteLink) }}
                    </div>
                </section>
            </div>

            <div class="admin-form-actions admin-form-actions-sticky">
                <a class="btn admin-btn admin-btn-secondary" href="{{ path('school_section_index') }}">Annuler</a>
                <button class="btn admin-btn admin-btn-primary" type="submit">Enregistrer</button>
            </div>
        {{ form_end(form) }}
    </div>
{% endblock %}
