first commit
This commit is contained in:
commit
e6c52820cd
227 changed files with 16156 additions and 0 deletions
83
Templates/projects/all_projects.html
Normal file
83
Templates/projects/all_projects.html
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
{% 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 %}
|
||||
57
Templates/projects/edit_project.html
Normal file
57
Templates/projects/edit_project.html
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{% extends 'layouts/base.html' %}
|
||||
|
||||
{% block title %}{% if project %}Éditer le projet{% else %}Nouveau projet{% endif %} - {{ client_name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1 class="h3">{% if project %}Éditer le projet{% else %}Nouveau projet{% endif %} - {{ client_name }}</h1>
|
||||
<div>
|
||||
<a href="{{ url_for('list_client_projects', client_id=client_id) }}" class="btn btn-outline-secondary">
|
||||
<i class="fas fa-arrow-left"></i> Retour aux projets
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="post" class="card p-3">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Nom du projet *</label>
|
||||
<input type="text" name="name" class="form-control" required value="{{ project.name if project else '' }}">
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="mb-3 col-md-4">
|
||||
<label class="form-label">Statut</label>
|
||||
<select name="status" class="form-select">
|
||||
{% set statuses = ['Nouveau', 'En cours', 'En attente', 'Terminé', 'Annulé'] %}
|
||||
{% for st in statuses %}
|
||||
<option value="{{ st }}" {% if project and project.status == st %}selected{% endif %}>{{ st }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3 col-md-4">
|
||||
<label class="form-label">Date de début</label>
|
||||
<input type="date" name="start_date" class="form-control" value="{{ project.start_date if project and project.start_date else '' }}">
|
||||
</div>
|
||||
<div class="mb-3 col-md-4">
|
||||
<label class="form-label">Date de fin</label>
|
||||
<input type="date" name="end_date" class="form-control" value="{{ project.end_date if project and project.end_date else '' }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Budget (€)</label>
|
||||
<input type="number" step="0.01" name="budget" class="form-control" value="{{ project.budget if project and project.budget is not none else '' }}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Description</label>
|
||||
<textarea name="description" rows="5" class="form-control">{{ project.description if project else '' }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="text-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-save"></i> Enregistrer
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
68
Templates/projects/list_projects.html
Normal file
68
Templates/projects/list_projects.html
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
{% extends 'layouts/base.html' %}
|
||||
|
||||
{% block title %}Projets - {{ client_name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1 class="h3">Projets de {{ client_name }}</h1>
|
||||
<div>
|
||||
<a href="{{ url_for('client_details', client_id=client_id) }}" class="btn btn-outline-secondary me-2">
|
||||
<i class="fas fa-user"></i> Détails client
|
||||
</a>
|
||||
<a href="{{ url_for('add_client_project', client_id=client_id) }}" class="btn btn-primary">
|
||||
<i class="fas fa-plus"></i> Nouveau projet
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if projects and projects|length > 0 %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<th>Statut</th>
|
||||
<th>Début</th>
|
||||
<th>Fin</th>
|
||||
<th>Budget</th>
|
||||
<th class="text-end">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for project in projects %}
|
||||
<tr>
|
||||
<td>{{ project.name }}</td>
|
||||
<td><span class="badge bg-secondary">{{ project.status }}</span></td>
|
||||
<td>{{ project.start_date or '—' }}</td>
|
||||
<td>{{ project.end_date or '—' }}</td>
|
||||
<td>
|
||||
{% if project.budget is not none %}
|
||||
{{ "%.2f"|format(project.budget) }} €
|
||||
{% else %}
|
||||
—
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<a class="btn btn-sm btn-outline-primary" href="{{ url_for('project_details', client_id=client_id, project_id=project.id) }}">
|
||||
<i class="fas fa-eye"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-outline-secondary" href="{{ url_for('edit_client_project', client_id=client_id, project_id=project.id) }}">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<form action="{{ url_for('delete_client_project', client_id=client_id, project_id=project.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 pour ce client. Créez-en un avec le bouton "Nouveau projet".
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
47
Templates/projects/project_details.html
Normal file
47
Templates/projects/project_details.html
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{% extends 'layouts/base.html' %}
|
||||
|
||||
{% block title %}Projet {{ project.name }} - {{ client_name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1 class="h3">Projet: {{ project.name }}</h1>
|
||||
<div>
|
||||
<a href="{{ url_for('list_client_projects', client_id=client_id) }}" class="btn btn-outline-secondary me-2">
|
||||
<i class="fas fa-arrow-left"></i> Retour aux projets
|
||||
</a>
|
||||
<a href="{{ url_for('edit_client_project', client_id=client_id, project_id=project.id) }}" class="btn btn-primary">
|
||||
<i class="fas fa-edit"></i> Éditer
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<dl class="row">
|
||||
<dt class="col-sm-3">Statut</dt>
|
||||
<dd class="col-sm-9"><span class="badge bg-secondary">{{ project.status }}</span></dd>
|
||||
|
||||
<dt class="col-sm-3">Date de début</dt>
|
||||
<dd class="col-sm-9">{{ project.start_date or '—' }}</dd>
|
||||
|
||||
<dt class="col-sm-3">Date de fin</dt>
|
||||
<dd class="col-sm-9">{{ project.end_date or '—' }}</dd>
|
||||
|
||||
<dt class="col-sm-3">Budget</dt>
|
||||
<dd class="col-sm-9">
|
||||
{% if project.budget is not none %}
|
||||
{{ "%.2f"|format(project.budget) }} €
|
||||
{% else %}
|
||||
—
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Description</dt>
|
||||
<dd class="col-sm-9">{{ project.description or '—' }}</dd>
|
||||
|
||||
<dt class="col-sm-3">ID du projet</dt>
|
||||
<dd class="col-sm-9"><code>{{ project.id }}</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue