Files

104 lines
4.1 KiB
Twig
Raw Permalink Normal View History

2025-10-24 16:13:37 +02:00
{% extends 'base.html.twig' %}
{% block title %}Projet - {{ projet.nom }}{% endblock %}
{% block body %}
<div class="d-flex justify-content-between align-items-center mb-4">
<h1>{{ projet.nom }}</h1>
<div>
<a href="{{ path('app_projet_edit', {'id': projet.id}) }}" class="btn btn-warning">
<i class="fas fa-edit"></i> Modifier
</a>
<a href="{{ path('app_projet_index') }}" class="btn btn-secondary">
<i class="fas fa-arrow-left"></i> Retour à la liste
</a>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Informations générales</h5>
</div>
<div class="card-body">
<p><strong>ID :</strong> {{ projet.id }}</p>
<p><strong>Nom :</strong> {{ projet.nom }}</p>
<p><strong>Statut :</strong>
{% 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>
</p>
<p><strong>Date de lancement :</strong> {{ projet.dateLancement ? projet.dateLancement|date('d/m/Y') : 'Non définie' }}</p>
<p><strong>Date de clôture :</strong> {{ projet.dateCloture ? projet.dateCloture|date('d/m/Y') : 'Non définie' }}</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Commentaire</h5>
</div>
<div class="card-body">
{% if projet.commentaire %}
<p>{{ projet.commentaire }}</p>
{% else %}
<p class="text-muted">Aucun commentaire</p>
{% endif %}
</div>
</div>
</div>
</div>
{% if projet.contributions|length > 0 %}
<div class="row mt-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Contributions ({{ projet.contributions|length }})</h5>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-sm">
<thead>
<tr>
<th>Membre</th>
<th>Date</th>
<th>Durée</th>
<th>Commentaire</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for contribution in projet.contributions %}
<tr>
<td>{{ contribution.membre }}</td>
<td>{{ contribution.dateContribution|date('d/m/Y') }}</td>
<td>{{ contribution.dureeFormatee }}</td>
<td>{{ contribution.commentaire|default('')|slice(0, 30) }}{% if contribution.commentaire|length > 30 %}...{% endif %}</td>
<td>
<a href="{{ path('app_contribution_show', {'id': contribution.id}) }}" class="btn btn-sm btn-info">
<i class="fas fa-eye"></i> Voir
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}