Réalisation finale
This commit is contained in:
69
templates/projet/edit.html.twig
Normal file
69
templates/projet/edit.html.twig
Normal file
@@ -0,0 +1,69 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Modifier Projet - {{ projet.nom }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1>Modifier Projet</h1>
|
||||
<div>
|
||||
<a href="{{ path('app_projet_show', {'id': projet.id}) }}" class="btn btn-info">
|
||||
<i class="fas fa-eye"></i> Voir
|
||||
</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-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ form_start(form) }}
|
||||
<div class="mb-3">
|
||||
{{ form_label(form.nom) }}
|
||||
{{ form_widget(form.nom) }}
|
||||
{{ form_errors(form.nom) }}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form_label(form.commentaire) }}
|
||||
{{ form_widget(form.commentaire) }}
|
||||
{{ form_errors(form.commentaire) }}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="mb-3">
|
||||
{{ form_label(form.dateLancement) }}
|
||||
{{ form_widget(form.dateLancement) }}
|
||||
{{ form_errors(form.dateLancement) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-3">
|
||||
{{ form_label(form.dateCloture) }}
|
||||
{{ form_widget(form.dateCloture) }}
|
||||
{{ form_errors(form.dateCloture) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form_label(form.statut) }}
|
||||
{{ form_widget(form.statut) }}
|
||||
{{ form_errors(form.statut) }}
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-success">
|
||||
<i class="fas fa-save"></i> Enregistrer
|
||||
</button>
|
||||
<a href="{{ path('app_projet_index') }}" class="btn btn-secondary">Annuler</a>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
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 %}
|
||||
64
templates/projet/new.html.twig
Normal file
64
templates/projet/new.html.twig
Normal file
@@ -0,0 +1,64 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Nouveau Projet{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1>Nouveau Projet</h1>
|
||||
<a href="{{ path('app_projet_index') }}" class="btn btn-secondary">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ form_start(form) }}
|
||||
<div class="mb-3">
|
||||
{{ form_label(form.nom) }}
|
||||
{{ form_widget(form.nom) }}
|
||||
{{ form_errors(form.nom) }}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form_label(form.commentaire) }}
|
||||
{{ form_widget(form.commentaire) }}
|
||||
{{ form_errors(form.commentaire) }}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="mb-3">
|
||||
{{ form_label(form.dateLancement) }}
|
||||
{{ form_widget(form.dateLancement) }}
|
||||
{{ form_errors(form.dateLancement) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-3">
|
||||
{{ form_label(form.dateCloture) }}
|
||||
{{ form_widget(form.dateCloture) }}
|
||||
{{ form_errors(form.dateCloture) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form_label(form.statut) }}
|
||||
{{ form_widget(form.statut) }}
|
||||
{{ form_errors(form.statut) }}
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-success">
|
||||
<i class="fas fa-save"></i> Créer
|
||||
</button>
|
||||
<a href="{{ path('app_projet_index') }}" class="btn btn-secondary">Annuler</a>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
103
templates/projet/show.html.twig
Normal file
103
templates/projet/show.html.twig
Normal file
@@ -0,0 +1,103 @@
|
||||
{% 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 %}
|
||||
Reference in New Issue
Block a user