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

{% block title %}Debug Labourage{% endblock %}

{% block body %}
<div class="container mt-4">
    <h1>Debug Labourage</h1>
    <div class="alert alert-info">
        <strong>Code INSEE demandé :</strong> {{ insee_code }}<br>
        <strong>Code INSEE trouvé :</strong> {{ city_insee_found }}<br>
        <strong>Nom de la ville trouvé :</strong> {{ city_name }}
    </div>
    {% if message %}
        <div class="alert alert-warning">{{ message }}</div>
    {% endif %}
    <h3>Détails bruts de la ville trouvée :</h3>
    <pre style="background:#222;color:#b5f;font-size:0.95em;padding:1em;border-radius:8px;overflow:auto;max-height:400px;">{{ city_debug|json_encode(constant('JSON_PRETTY_PRINT')) }}</pre>
    {% if stats %}
        <h3>Stats associées :</h3>
        <pre style="background:#222;color:#b5f;font-size:0.95em;padding:1em;border-radius:8px;overflow:auto;max-height:400px;">{{ dump(stats) }}</pre>
    {% endif %}
    <a href="{{ path('app_admin_labourer', {'insee_code': insee_code, 'debug': 1}) }}" class="btn btn-primary mt-3">Rafraîchir debug</a>
    <a href="{{ path('app_admin_stats', {'insee_code': insee_code}) }}" class="btn btn-secondary mt-3">Retour aux stats</a>
</div>
{% endblock %} 