first commit

This commit is contained in:
2025-12-02 14:07:54 +01:00
commit 674ad5f06f
13 changed files with 1484 additions and 0 deletions

168
templates/project_view.html Normal file
View File

@@ -0,0 +1,168 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>{{ project.name }} - Calendrier de l'Avent</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" />
<style>
body {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.card {
backdrop-filter: blur(10px);
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
}
.person-winner {
font-size: 2.5rem;
font-weight: 700;
color: gold;
text-shadow: 0 0 10px #ffd700;
}
</style>
</head>
<body>
<div class="container py-5">
<div class="text-center mb-5">
<img src="{{ project.image_url or url_for('static', filename='default_project.png') }}" alt="Illustration projet" style="max-height:180px; border-radius:12px; margin-bottom:15px;" />
<h1 class="display-4 fw-bold mb-1">{{ project.name }}</h1>
<p class="lead text-light">{{ project.description or '' }}</p>
</div>
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="alert alert-success alert-dismissible fade show mb-4">
{% for m in messages %}
<div><i class="fas fa-star me-2"></i>{{ m }}</div>
{% endfor %}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endif %}
{% endwith %}
<div class="card mb-5 text-center p-5">
<h2 class="display-5 mb-4">🎄 Jour {{ today_day }} 🎄</h2>
{% if today_draw %}
<div class="mb-4">
<i class="fas fa-crown fa-4x text-warning mb-3"></i>
<div class="person-winner">{{ today_draw.name }}</div>
<small>{{ today_draw.draw_time }}</small>
</div>
<div class="alert alert-warning">
<i class="fas fa-check-circle me-2"></i>Déjà tiré !
</div>
{% else %}
<div class="mb-4">
<i class="fas fa-question-circle fa-5x text-muted mb-3"></i>
<h3 class="text-white-50">Prêt pour le tirage ?</h3>
</div>
{% endif %}
<div class="btn-group w-100" role="group">
<a href="{{ url_for('draw_today', project_id=project.id) }}" class="btn btn-primary btn-lg">
<i class="fas fa-dice me-2"></i>Tirer aujourd'hui
</a>
{% set missing_days = project.total_days - all_draws|length %}
{% if missing_days > 0 %}
<a href="{{ url_for('catchup_draws_route', project_id=project.id) }}"
class="btn btn-warning btn-lg"
onclick="return confirm('Rattraper TOUS les {{ missing_days }} jours manquants ?')">
<i class="fas fa-magic me-2"></i>Rattraper ({{ missing_days }})
</a>
{% endif %}
</div>
</div>
<div class="row mb-5">
<div class="col-md-6">
<div class="card text-white bg-success">
<div class="card-body">
<h5><i class="fas fa-calendar-check me-2"></i>Tirages effectués</h5>
<h2>{{ all_draws|length }} / {{ project.total_days }}</h2>
<div class="progress" style="height: 20px;">
<div class="progress-bar bg-light" style="width: {{ (all_draws|length / project.total_days * 100)|round(0) }}%">
{{ (all_draws|length / project.total_days * 100)|round(0) }}%
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5><i class="fas fa-history me-2"></i>Historique récent</h5>
</div>
<div class="card-body p-0">
{% if all_draws %}
<div class="list-group list-group-flush">
{% for d in all_draws[-8:] %}
<div class="list-group-item px-3 py-2">
<div class="d-flex justify-content-between">
<h6 class="mb-1">
<span class="badge bg-primary rounded-pill me-2">J{{ d.day }}</span>
{{ d.name }}
</h6>
<small>{{ d.draw_time[:10] }}</small>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="text-center py-4 text-muted">
<i class="fas fa-calendar-times fa-3x mb-3"></i>
Aucun tirage
</div>
{% endif %}
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5><i class="fas fa-users me-2"></i>Participants ({{ stats|length }})</h5>
</div>
<div class="card-body p-0">
<table class="table table-bordered table-striped mb-0">
<thead>
<tr>
<th>Nom</th>
<th>Tirages</th>
<th>Max tirages</th>
<th>Restant</th>
</tr>
</thead>
<tbody>
{% for p in stats %}
<tr>
<td>{{ p.name }}</td>
<td>{{ p.draws }}</td>
<td>{{ p.max_draws }}</td>
<td>{{ p.max_draws - p.draws }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="text-center mt-5">
<a href="{{ url_for('dashboard') }}" class="btn btn-outline-light btn-lg me-2">
<i class="fas fa-arrow-left me-2"></i>Retour aux projets
</a>
<a href="{{ url_for('admin_project_people', project_id=project.id) }}" class="btn btn-outline-light btn-lg ms-2">
<i class="fas fa-cog me-2"></i>Administration
</a>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>