Modification mise en page liste ateliers quand il n'y a pas encore d'ateliers

This commit is contained in:
Aymeric SERRA 2023-02-09 09:23:54 +01:00
parent 37c1e24e1a
commit c0357d6947
Signed by: oupson
GPG Key ID: 3BD88615552EFCB7
1 changed files with 43 additions and 38 deletions

View File

@ -3,46 +3,51 @@
{% block title %}Atelier index{% endblock %}
{% block body %}
<h1>Atelier index</h1>
<h1>Liste des Ateliers</h1>
<table class="table">
<thead>
<tr>
<th scope="row">Id</th>
<th scope="col">Nom</th>
<th class="" scope="col">Description</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
{% for atelier in ateliers %}
{% if (ateliers | length) > 0 %}
<table class="table">
<thead>
<tr>
<td>{{ atelier.id }}</td>
<td>{{ atelier.nom }}</td>
<td>{{ atelier.description | raw }}</td>
<td>
<div class="d-flex flex-row align-content-end">
<a class="btn btn-outline-primary m-1"
href="{{ path('app_atelier_show', {'id': atelier.id}) }}">Afficher</a>
{% if app.user and app.user == atelier.instructeur %}
<th scope="row">Id</th>
<th scope="col">Nom</th>
<th class="" scope="col">Description</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
{% for atelier in ateliers %}
<tr>
<td>{{ atelier.id }}</td>
<td>{{ atelier.nom }}</td>
<td>{{ atelier.description | raw }}</td>
<td>
<div class="d-flex flex-row align-content-end">
<a class="btn btn-outline-primary m-1"
href="{{ path('app_atelier_edit', {'id': atelier.id}) }}">Modifier</a>
{% else %}
<button class="btn btn-outline-secondary m-1"
href="{{ path('app_atelier_edit', {'id': atelier.id}) }}" disabled>Modifier</button>
{% endif %}
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
href="{{ path('app_atelier_show', {'id': atelier.id}) }}">Afficher</a>
{% if app.user and app.user == atelier.instructeur %}
<a class="btn btn-outline-primary m-1"
href="{{ path('app_atelier_edit', {'id': atelier.id}) }}">Modifier</a>
{% else %}
<button class="btn btn-outline-secondary m-1"
href="{{ path('app_atelier_edit', {'id': atelier.id}) }}" disabled>Modifier
</button>
{% endif %}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="d-flex justify-content-center">
<a class="btn btn-primary mb-3" href="{{ path('app_atelier_new') }}">Créer atelier</a>
</div>
<div class="d-flex justify-content-center">
<a class="btn btn-primary mb-3" href="{{ path('app_atelier_new') }}">Créer atelier</a>
</div>
{% else %}
<div class="alert alert-info" role="alert">
Il n'y a pas encore d'ateliers. Vous pouvez commencer par <a class="alert-link"
href="{{ path('app_atelier_new') }}">en créer
un !</a>
</div>
{% endif %}
{% endblock %}