{% extends 'base.html.twig' %}

{% block entete %}
    {{ include('entete.html.twig') }}

{% endblock %}

{% block corps %}
    <footer class="barre_etat">
        <p>Prédictions : {{suivi.getNombreFait() }}/125</p>
        <span class="flex_spacer"></span>
        {% if app.user.getPaiement() == false %}
            <a class="mdc-button mdc-button--raised mdc-ripple-upgraded" href="{{ path('paiement') }}">Officialiser vos prédictions (3$)</a>
        {% else %}
            <a class="mdc-button mdc-button--raised mdc-ripple-upgraded" href="{{ path('montrer_prediction') }}">Sommaire de vos prédictions</a>
        {% endif %}
    </footer>
    
    <section class="liste mdc-list-group">
        {% for index, reg in region %}
            <h3 class="mdc-list-group__subheader">{{reg['region'].getNom()}}</h3>
            <ul class="mdc-list">
                {% for cle, circ in reg['circonscription'] %}
                    {% if loop.last %}
                        {% set _bsq = '' %}
                    {% else %}
                        {% set _bsq = reg['circonscription'][cle+1].getBsq() %}
                    {% endif %}
                    <li class="mdc-list-item "><a href="{{ path('circonscription', {'bsq': circ.getBsq()}) }}">
                        <span class="mdc-list-item__text">
                        
                            {{ circ.getCirconscription() }}
                        
                            <span class="mdc-list-item__secondary-text">
                           {#  {% if circ.getDeputeActuel() %}
                        Député actuel : {{ circ.getDeputeActuel().getNom()}}, {{ circ.getDeputeActuel().getPrenom() }}
                    {% endif %}
                    #}
                    {% if circ.prediction is not empty%}
                        Votre prédiction : {{circ.prediction.candidat.getNom() }}, {{circ.prediction.candidat.getPrenom() }} ({{circ.prediction.candidat.getParti().getNom()}})
                    {% endif %}
                            </span>
                        </span>
                    </a>
                    </li> 
                {% endfor %}
                <li role="separator" class="mdc-list-divider">
            </ul>
    {% endfor %}
    </section>
{% endblock %}
