first commit
This commit is contained in:
141
templates/admin_project_people.html
Normal file
141
templates/admin_project_people.html
Normal file
@@ -0,0 +1,141 @@
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Gestion des utilisateurs - {{ project.name }}</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<div class="container py-5">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1>Utilisateurs pour: <strong>{{ project.name }}</strong></h1>
|
||||
<a href="{{ url_for('admin_projects') }}" class="btn btn-outline-primary">
|
||||
<i class="fas fa-arrow-left me-2"></i>Retour projets
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<div class="alert alert-info alert-dismissible fade show mb-4">
|
||||
{% for m in messages %}
|
||||
<div><i class="fas fa-info-circle me-2"></i>{{ m }}</div>
|
||||
{% endfor %}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<div class="row g-4 mb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h5 class="mb-0"><i class="fas fa-plus me-2"></i>Ajouter un utilisateur</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="add" />
|
||||
<div class="mb-3">
|
||||
<input type="text" name="name" placeholder="Nom complet" class="form-control" required />
|
||||
</div>
|
||||
<button class="btn btn-success w-100">
|
||||
<i class="fas fa-user-plus me-2"></i>Ajouter
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header bg-info text-white">
|
||||
<h6 class="mb-0"><i class="fas fa-file-csv me-2"></i>Import CSV</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="action" value="import_csv" />
|
||||
<div class="mb-3">
|
||||
<input type="file" name="csv_file" accept=".csv" class="form-control" required />
|
||||
<small class="text-muted d-block mt-1">
|
||||
Format: une colonne <code>name</code><br>
|
||||
Exemple: <code>Marie</code><br>
|
||||
<code>Pierre</code>
|
||||
</small>
|
||||
</div>
|
||||
<button class="btn btn-info w-100">
|
||||
<i class="fas fa-upload me-2"></i>Importer
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header bg-warning text-dark">
|
||||
<h6 class="mb-0"><i class="fas fa-sync-alt me-2"></i>Réinitialiser</h6>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<form method="post" class="d-inline" onsubmit="return confirm('⚠️ Remettre TOUS les tirages à zéro ?');">
|
||||
<input type="hidden" name="action" value="reset_draws">
|
||||
<button class="btn btn-warning btn-lg w-100">
|
||||
<i class="fas fa-undo me-2"></i>Reset tirages
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5>Liste des {{ people|length }} participants (Quota: {{ people[0].max_draws if people else 0 }} max)</h5>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover mb-0">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<th>Tirages</th>
|
||||
<th>Maximum</th>
|
||||
<th>Restant</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for person in people %}
|
||||
<tr>
|
||||
<td><i class="fas fa-user-circle text-primary me-2"></i>{{ person.name }}</td>
|
||||
<td><span class="badge bg-info">{{ person.draws }}</span></td>
|
||||
<td>{{ person.max_draws }}</td>
|
||||
<td>
|
||||
<span class="badge {% if person.draws < person.max_draws %}bg-success{% else %}bg-danger{% endif %}">
|
||||
{{ person.max_draws - person.draws }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<form method="post" class="d-inline" onsubmit="return confirm('Supprimer {{ person.name }} ?');">
|
||||
<input type="hidden" name="action" value="delete" />
|
||||
<input type="hidden" name="person_id" value="{{ person.id }}" />
|
||||
<button class="btn btn-sm btn-danger">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<a href="{{ url_for('project_view', project_id=project.id) }}" class="btn btn-primary">
|
||||
<i class="fas fa-calendar me-2"></i>Voir le calendrier
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user