83 lines
2.8 KiB
HTML
83 lines
2.8 KiB
HTML
{% extends 'layouts/base.html' %}
|
|
|
|
{% block title %}Tous les projets{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h1 class="h3">Projets</h1>
|
|
</div>
|
|
|
|
<form method="get" class="card p-3 mb-4">
|
|
<div class="row g-3">
|
|
<div class="col-md-4">
|
|
<label class="form-label">Client</label>
|
|
<select name="client_id" class="form-select" onchange="this.form.submit()">
|
|
<option value="">Tous les clients</option>
|
|
{% for c in clients %}
|
|
<option value="{{ c.id }}" {% if selected_client == c.id %}selected{% endif %}>{{ c.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label class="form-label">Recherche</label>
|
|
<input type="search" name="q" class="form-control" placeholder="Nom, statut, description..." value="{{ q or '' }}">
|
|
</div>
|
|
<div class="col-md-2 d-flex align-items-end">
|
|
<button class="btn btn-primary w-100" type="submit">
|
|
<i class="fas fa-search"></i> Rechercher
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
{% if projects and projects|length > 0 %}
|
|
<div class="table-responsive">
|
|
<table class="table table-hover align-middle">
|
|
<thead>
|
|
<tr>
|
|
<th>Projet</th>
|
|
<th>Client</th>
|
|
<th>Statut</th>
|
|
<th>Début</th>
|
|
<th>Fin</th>
|
|
<th>Budget</th>
|
|
<th class="text-end">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for p in projects %}
|
|
<tr>
|
|
<td>{{ p.name }}</td>
|
|
<td>{{ p.client_name }}</td>
|
|
<td><span class="badge bg-secondary">{{ p.status }}</span></td>
|
|
<td>{{ p.start_date or '—' }}</td>
|
|
<td>{{ p.end_date or '—' }}</td>
|
|
<td>
|
|
{% if p.budget is not none %}
|
|
{{ "%.2f"|format(p.budget) }} €
|
|
{% else %} — {% endif %}
|
|
</td>
|
|
<td class="text-end">
|
|
<a class="btn btn-sm btn-outline-primary" href="{{ url_for('project_details', client_id=p.client_id, project_id=p.id) }}">
|
|
<i class="fas fa-eye"></i>
|
|
</a>
|
|
<a class="btn btn-sm btn-outline-secondary" href="{{ url_for('edit_client_project', client_id=p.client_id, project_id=p.id) }}">
|
|
<i class="fas fa-edit"></i>
|
|
</a>
|
|
<form action="{{ url_for('delete_client_project', client_id=p.client_id, project_id=p.id) }}" method="post" class="d-inline" onsubmit="return confirm('Supprimer ce projet ?');">
|
|
<button type="submit" class="btn btn-sm btn-outline-danger">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<div class="alert alert-info">
|
|
Aucun projet trouvé avec ces critères.
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|