Réalisation finale
This commit is contained in:
64
templates/projet/index.html.twig
Normal file
64
templates/projet/index.html.twig
Normal file
@@ -0,0 +1,64 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Projets{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1>Projets</h1>
|
||||
<a href="{{ path('app_projet_new') }}" class="btn btn-success">
|
||||
<i class="fas fa-plus"></i> Nouveau Projet
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nom</th>
|
||||
<th>Statut</th>
|
||||
<th>Date lancement</th>
|
||||
<th>Date clôture</th>
|
||||
<th>Commentaire</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for projet in projets %}
|
||||
<tr>
|
||||
<td>{{ projet.id }}</td>
|
||||
<td>{{ projet.nom }}</td>
|
||||
<td>
|
||||
{% set statutClass = {
|
||||
'en_attente': 'warning',
|
||||
'en_cours': 'info',
|
||||
'termine': 'success',
|
||||
'annule': 'danger'
|
||||
} %}
|
||||
<span class="badge bg-{{ statutClass[projet.statut]|default('secondary') }}">
|
||||
{% for label, value in projet.getStatutChoices() %}
|
||||
{% if value == projet.statut %}{{ label }}{% endif %}
|
||||
{% endfor %}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ projet.dateLancement ? projet.dateLancement|date('d/m/Y') : '-' }}</td>
|
||||
<td>{{ projet.dateCloture ? projet.dateCloture|date('d/m/Y') : '-' }}</td>
|
||||
<td>{{ projet.commentaire|default('')|slice(0, 50) }}{% if projet.commentaire|length > 50 %}...{% endif %}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_projet_show', {'id': projet.id}) }}" class="btn btn-sm btn-info">
|
||||
<i class="fas fa-eye"></i> Voir
|
||||
</a>
|
||||
<a href="{{ path('app_projet_edit', {'id': projet.id}) }}" class="btn btn-sm btn-warning">
|
||||
<i class="fas fa-edit"></i> Modifier
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="7" class="text-center">Aucun projet trouvé</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user