première release
This commit is contained in:
150
templates/stats.html
Normal file
150
templates/stats.html
Normal file
@@ -0,0 +1,150 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>📊 Statistiques - Menu Miam</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||
<style>
|
||||
.stats-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.stat-card h2 {
|
||||
margin-top: 0;
|
||||
color: #2c3e50;
|
||||
border-bottom: 2px solid #3498db;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.stat-number {
|
||||
font-size: 48px;
|
||||
font-weight: bold;
|
||||
color: #3498db;
|
||||
text-align: center;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.stat-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.stat-list li {
|
||||
padding: 10px;
|
||||
margin: 5px 0;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.stat-badge {
|
||||
background: #3498db;
|
||||
color: white;
|
||||
padding: 5px 15px;
|
||||
border-radius: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.back-button {
|
||||
display: inline-block;
|
||||
margin-bottom: 20px;
|
||||
padding: 10px 20px;
|
||||
background: #3498db;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.back-button:hover {
|
||||
background: #2980b9;
|
||||
}
|
||||
|
||||
.grid-2 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="stats-container">
|
||||
<a href="{{ url_for('menu') }}" class="back-button">← Retour au menu</a>
|
||||
|
||||
<h1>📊 Statistiques des recettes</h1>
|
||||
|
||||
<!-- Statistiques générales -->
|
||||
<div class="grid-2">
|
||||
<div class="stat-card">
|
||||
<h2>📚 Recettes disponibles</h2>
|
||||
<div class="stat-number">{{ total_recettes }}</div>
|
||||
</div>
|
||||
|
||||
<div class="stat-card">
|
||||
<h2>📅 Recettes planifiées</h2>
|
||||
<div class="stat-number">{{ total_planifiees }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Top 10 recettes -->
|
||||
<div class="stat-card">
|
||||
<h2>🏆 Top 10 des recettes les plus utilisées</h2>
|
||||
{% if top_recettes %}
|
||||
<ul class="stat-list">
|
||||
{% for recette in top_recettes %}
|
||||
<li>
|
||||
<span>{{ recette['nom'] }}</span>
|
||||
<span class="stat-badge">{{ recette['count'] }}×</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p style="text-align: center; color: #7f8c8d;">Aucune recette planifiée pour le moment</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Top 10 accompagnements -->
|
||||
<div class="stat-card">
|
||||
<h2>🥗 Top 10 des accompagnements les plus utilisés</h2>
|
||||
{% if top_accompagnements %}
|
||||
<ul class="stat-list">
|
||||
{% for acc in top_accompagnements %}
|
||||
<li>
|
||||
<span>{{ acc['nom'] }}</span>
|
||||
<span class="stat-badge">{{ acc['count'] }}×</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p style="text-align: center; color: #7f8c8d;">Aucun accompagnement utilisé pour le moment</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Recettes jamais utilisées -->
|
||||
<div class="stat-card">
|
||||
<h2>💤 Recettes jamais utilisées ({{ jamais_utilisees|length }})</h2>
|
||||
{% if jamais_utilisees %}
|
||||
<ul class="stat-list">
|
||||
{% for recette in jamais_utilisees %}
|
||||
<li>{{ recette['nom'] }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p style="text-align: center; color: #27ae60; font-weight: bold;">🎉 Toutes vos recettes ont été utilisées au moins une fois !</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user