From 6acb633c2e99475e360eab9386499ef95c201f3f Mon Sep 17 00:00:00 2001 From: Aguay Date: Tue, 2 Dec 2025 14:41:31 +0100 Subject: [PATCH] add public view --- .gitignore | 54 +++++++++++ README.md | 22 +++++ templates/public_project_view.html | 145 +++++++++++++++++++++++++++++ templates/public_projects.html | 76 +++++++++++++++ 4 files changed, 297 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 templates/public_project_view.html create mode 100644 templates/public_projects.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..070eb7f --- /dev/null +++ b/.gitignore @@ -0,0 +1,54 @@ +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# Environnement virtuel +venv/ +env/ +ENV/ + +# Base de données +*.db +*.sqlite +*.sqlite3 + +# Logs +*.log + +# Docker +.dockerignore + +# IDE +.vscode/ +.idea/ +*.swp +*.swo + +# OS +.DS_Store +Thumbs.db + +# Static uploads (optionnel - garder les images uploadées) +# static/uploads/ + diff --git a/README.md b/README.md new file mode 100644 index 0000000..213b4a5 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# 🎄 Calendrier de l'Avent - Tirage Aléatoire Multi-Projets + +Application web Flask + SQLite pour organiser des calendriers de l'Avent avec tirage aléatoire équitable. + +[![Docker](https://img.shields.io/badge/Docker-Ready-brightgreen.svg)](https://hub.docker.com/) +[![Python](https://img.shields.io/badge/Python-3.10-blue.svg)](https://python.org/) +[![Flask](https://img.shields.io/badge/Flask-3.0-green.svg)](https://flask.palletsprojects.com/) + +## ✨ Fonctionnalités + +- **Multi-projets** : Créez plusieurs calendriers indépendants +- **Tirage équitable** : Calcul automatique des quotas par participant +- **Rattrapage magique** : Bouton "Rattraper X jours manquants" +- **Upload images** : Illustration personnalisée par projet +- **Import CSV** : Chargez vos participants en masse +- **Admin complet** : Gestion utilisateurs/projets +- **Thème Noël** : Interface festive et responsive +- **Docker** : Déploiement 1-clic + +## 🚀 Installation rapide (Docker) + + diff --git a/templates/public_project_view.html b/templates/public_project_view.html new file mode 100644 index 0000000..42d549d --- /dev/null +++ b/templates/public_project_view.html @@ -0,0 +1,145 @@ + + + + + {{ project.name }} - Calendrier public + + + + + +
+
+ {% if project.image_url %} + Illustration + {% endif %} +

{{ project.name }}

+ {% if project.description %} +

{{ project.description }}

+ {% endif %} +
+ +
+

🎁 Jour {{ today_day }} 🎁

+ {% if today_draw %} +
+ +
{{ today_draw.name }}
+ {{ today_draw.draw_time }} +
+
+ Tirage effectué +
+ {% else %} +
+ +

Pas encore tiré aujourd'hui

+
+
+ Attente du tirage du jour... +
+ {% endif %} +
+ +
+
+
+
+
Progression
+

{{ all_draws|length }} / {{ project.total_days }} jours

+
+
+ {{ (all_draws|length / project.total_days * 100) | round(0) }}% +
+
+
+
+
+
+ +
+
+
+
+
Derniers tirages
+
+
+ {% if all_draws %} +
+ {% for draw in all_draws[-10:] %} +
+
+
+ Jour {{ draw.day }} + {{ draw.name }} +
+ {{ draw.draw_time[:10] }} +
+
+ {% endfor %} +
+ {% else %} +
+ +

Aucun tirage effectué

+
+ {% endif %} +
+
+
+ +
+
+
+
Participants ({{ stats|length }})
+
+
+
+ + + + + + + + + + {% for stat in stats %} + + + + + + {% endfor %} + +
ParticipantTiragesRestant
{{ stat.name }}{{ stat.draws }}{{ stat.max_draws - stat.draws }}
+
+
+
+
+
+ + +
+ + + + diff --git a/templates/public_projects.html b/templates/public_projects.html new file mode 100644 index 0000000..f91a609 --- /dev/null +++ b/templates/public_projects.html @@ -0,0 +1,76 @@ + + + + + Calendriers de l'Avent Publics + + + + + +
+
+

🎄 Calendriers de l'Avent publics 🎄

+

Découvrez tous les calendriers disponibles

+
+ +
+ {% for project in projects %} +
+
+
+ {% if project.image_url %} + {{ project.name }} + {% else %} +
+ +
+ {% endif %} + +

{{ project.name }}

+ {% if project.description %} +

{{ project.description }}

+ {% endif %} + +
+ + {{ project.total_days }} jours + +
+ + + Voir le calendrier + +
+
+
+ {% else %} +
+ +

Aucun calendrier disponible

+
+ {% endfor %} +
+ + +
+ + + + +