rendu-CSC4104/templates/collection_fractal/index.html.twig
2025-06-28 12:17:52 +02:00

79 lines
No EOL
3.9 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}Collection Fractal{% endblock %}
{% block main %}
<div class="text-center mt-3 mb-3">
<a href="{{ path('app_collection_fractal_new', {'id': app.user.membreFractal.id}) }}" class="btn btn-success"><h2>Nouvelle Collection</h2></a>
</div>
{% if 'ROLE_ADMIN' in app.user.roles %}
<div class="text-center mb-3"><h1>Toutes les collections</h1></div>
{% for collection in priv_collections_fractal %}
<div class="card shadow p-3 mb-5 bg-body-tertiary rounded bg-light mx-auto" style="width: 25rem;">
<img src='https://render.fineartamerica.com/images/rendered/default/flat/tapestry/images/artworkimages/medium/1/buddhabrot-fractal-buddha-miroslav-nemecek.jpg?&targetx=0&targety=-68&imagewidth=930&imageheight=930&modelwidth=930&modelheight=794&backgroundcolor=000018&orientation=1&producttype=tapestry-50-61' class="mx-auto p-2" alt="collection" width="100" height="100">
<div class="card-body mx-auto p-2">
<h5 class="card-title text-center">{{ collection.name }}</h5>
<p class="card-text text-center">Collection de {{ collection.membreFractal }}</p>
<p class="card-text text-center">{{ collection.ispublic ? 'Publique' : 'Privée' }}</p>
<div class="container mx-auto p-2">
<a href="{{ path('app_collection_fractal_show',{'id':collection.id}) }}" class="btn btn-primary">Détails</a>
<a href="{{ path('app_collection_fractal_edit',{'id':collection.id}) }}" class="btn btn-danger">Éditer</a>
</div>
</div>
</div>
{% endfor %}
{% else %}
<div class=text-center><h1>Collections Fractal</h1></div>
{% for collection in collection_fractales %}
<div class="card shadow p-3 mb-5 bg-body-tertiary rounded bg-light mx-auto" style="width: 25rem;">
<img src='https://render.fineartamerica.com/images/rendered/default/flat/tapestry/images/artworkimages/medium/1/buddhabrot-fractal-buddha-miroslav-nemecek.jpg?&targetx=0&targety=-68&imagewidth=930&imageheight=930&modelwidth=930&modelheight=794&backgroundcolor=000018&orientation=1&producttype=tapestry-50-61' class="mx-auto" alt="collection" width="100" height="100">
<div class="card-body mx-auto">
<h5 class="card-title text-center">{{ collection.name }}</h5>
<p class="card-text text-center">Collection de {{ collection.membreFractal }}</p>
<div class="container">
<a href="{{ path('app_collection_fractal_show',{'id':collection.id}) }}" class="btn btn-primary text-center">Détails</a>
{% if app.user.membreFractal.id == collection.membreFractal.id %}
<a href="{{ path('app_collection_fractal_edit',{'id':collection.id}) }}" class="btn btn-danger">Éditer</a>
{% endif %}
</div>
</div>
</div> {% endfor %}
<div class=text-center><h1>Mes Collections Privées</h1></div>
<table class="table">
<thead>
<tr>
<th>Nom</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for collection_fractal in priv_collections_fractal %}
<tr>
<td>{{ collection_fractal.name }}</td>
<td>
<a href="{{ path('app_collection_fractal_show', {'id': collection_fractal.id}) }}" class="btn btn-primary">Afficher</a>
<a href="{{ path('app_collection_fractal_edit', {'id': collection_fractal.id}) }}" class="btn btn-danger">Éditer</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">Vous n'avez pas de collection privée.</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}