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

{% block title %}Hello CarteFractalController!{% endblock %}
{% block main %}
    <div class="text-center">
        {% if 'ROLE_ADMIN' in app.user.roles %}
            <h1>Liste des Cartes</h1>
        {% else %}
            <h1 class="mb-3">Mes Cartes</h1>
        {% endif %}
            {% for carte in cartesfractal %}
                <a href="{{ path('app_carte_fractal_show',{'id': carte.id}) }}" class="btn bg-success text-light">
                        <img src={{ vich_uploader_asset(carte,'imageFile') }} class="mx-auto p-2 img-fluid" alt="carte" />  
                        <div class="card-body mx-auto p-2">
                            <h5 class="card-title text-center">{{ carte.description }}</h5>        
                        </div>
                </a>
            {% endfor %}
    </div>

{% endblock %}
