430 lines
15 KiB
HTML
430 lines
15 KiB
HTML
{% load static %}
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Flexi Teambuilding - Résultats</title>
|
|
<link rel="icon" href="{% static 'common/favicon.ico' %}" sizes="any">
|
|
|
|
<!-- Google Fonts -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Plus+Jakarta+Sans:wght@300;400;500;700&display=swap" rel="stylesheet">
|
|
|
|
<!-- Bootstrap Icons (local) -->
|
|
<link href="{% static 'common/bootstrap-icons.min.css' %}" rel="stylesheet">
|
|
<!-- Bootstrap CSS (local) -->
|
|
<link href="{% static 'common/bootstrap.min.css' %}" rel="stylesheet">
|
|
|
|
<style>
|
|
:root {
|
|
--bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #311042 100%);
|
|
--card-bg: rgba(30, 41, 59, 0.45);
|
|
--card-border: rgba(255, 255, 255, 0.08);
|
|
--accent-color: #06b6d4;
|
|
--accent-gradient: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
|
|
--text-main: #f8fafc;
|
|
--text-muted: #94a3b8;
|
|
--star-color: #fbbf24;
|
|
--success-color: #10b981;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Plus Jakarta Sans', sans-serif;
|
|
background: var(--bg-gradient);
|
|
background-attachment: fixed;
|
|
color: var(--text-main);
|
|
min-height: 100vh;
|
|
padding: 3rem 0;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
h1, h2, h3, .heading-font {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-weight: 800;
|
|
}
|
|
|
|
.glass-header {
|
|
background: rgba(15, 23, 42, 0.4);
|
|
backdrop-filter: blur(16px);
|
|
border-bottom: 1px solid var(--card-border);
|
|
padding: 2rem;
|
|
border-radius: 24px;
|
|
margin-bottom: 3rem;
|
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
|
|
text-align: center;
|
|
position: relative;
|
|
}
|
|
|
|
.header-title {
|
|
font-size: 2.8rem;
|
|
background: linear-gradient(120deg, #60a5fa, #38bdf8, #34d399);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.header-subtitle {
|
|
color: var(--text-muted);
|
|
font-size: 1.1rem;
|
|
font-weight: 300;
|
|
}
|
|
|
|
.success-banner {
|
|
background: rgba(16, 185, 129, 0.12);
|
|
border: 1px solid rgba(16, 185, 129, 0.3);
|
|
border-radius: 16px;
|
|
padding: 1.25rem 2rem;
|
|
margin-bottom: 2.5rem;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1rem;
|
|
color: #a7f3d0;
|
|
box-shadow: 0 8px 20px rgba(16, 185, 129, 0.08);
|
|
animation: slideInDown 0.5s ease-out;
|
|
}
|
|
|
|
@keyframes slideInDown {
|
|
from {
|
|
transform: translateY(-20px);
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
transform: translateY(0);
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
.stats-summary {
|
|
background: rgba(15, 23, 42, 0.3);
|
|
border: 1px solid var(--card-border);
|
|
border-radius: 20px;
|
|
padding: 1.5rem 2.5rem;
|
|
margin-bottom: 2.5rem;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 2rem;
|
|
text-align: center;
|
|
}
|
|
|
|
.stats-number {
|
|
font-size: 3.5rem;
|
|
font-weight: 800;
|
|
background: var(--accent-gradient);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
line-height: 1;
|
|
}
|
|
|
|
.results-container {
|
|
background: var(--card-bg);
|
|
backdrop-filter: blur(12px);
|
|
border: 1px solid var(--card-border);
|
|
border-radius: 24px;
|
|
padding: 2.5rem;
|
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
|
|
margin-bottom: 3rem;
|
|
}
|
|
|
|
.result-row {
|
|
padding: 1.75rem 0;
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.result-row:last-child {
|
|
border-bottom: none;
|
|
padding-bottom: 0;
|
|
}
|
|
|
|
.result-row:first-child {
|
|
padding-top: 0;
|
|
}
|
|
|
|
.proposal-name {
|
|
font-size: 1.25rem;
|
|
font-weight: 600;
|
|
color: #f1f5f9;
|
|
margin-bottom: 0.75rem;
|
|
}
|
|
|
|
.stars-avg {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.star-icon {
|
|
font-size: 1.3rem;
|
|
color: var(--star-color);
|
|
}
|
|
|
|
.star-icon.empty {
|
|
color: #475569;
|
|
}
|
|
|
|
.score-badge {
|
|
background: rgba(251, 191, 36, 0.15);
|
|
color: #fbbf24;
|
|
padding: 0.25rem 0.6rem;
|
|
border-radius: 6px;
|
|
font-size: 0.85rem;
|
|
font-weight: 700;
|
|
margin-left: 0.5rem;
|
|
border: 1px solid rgba(251, 191, 36, 0.25);
|
|
}
|
|
|
|
.custom-progress {
|
|
background: #1e293b;
|
|
height: 14px;
|
|
border-radius: 50px;
|
|
overflow: hidden;
|
|
border: 1px solid rgba(255, 255, 255, 0.03);
|
|
margin-top: 0.5rem;
|
|
}
|
|
|
|
.custom-progress-bar {
|
|
background: var(--accent-gradient);
|
|
height: 100%;
|
|
border-radius: 50px;
|
|
transition: width 1s ease-out;
|
|
box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
|
|
}
|
|
|
|
.participants-card {
|
|
background: var(--card-bg);
|
|
backdrop-filter: blur(12px);
|
|
border: 1px solid var(--card-border);
|
|
border-radius: 24px;
|
|
padding: 2.5rem;
|
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.participant-item {
|
|
background: rgba(15, 23, 42, 0.3);
|
|
border: 1px solid rgba(255, 255, 255, 0.03);
|
|
border-radius: 12px;
|
|
padding: 0.8rem 1.2rem;
|
|
margin-bottom: 0.75rem;
|
|
font-size: 0.95rem;
|
|
color: #cbd5e1;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.participant-item span.time {
|
|
font-size: 0.75rem;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.btn-action-back {
|
|
background: transparent;
|
|
border: 1px solid var(--card-border);
|
|
color: var(--text-muted);
|
|
font-weight: 500;
|
|
font-size: 0.95rem;
|
|
padding: 0.75rem 1.75rem;
|
|
border-radius: 12px;
|
|
transition: all 0.3s ease;
|
|
text-decoration: none;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.btn-action-back:hover {
|
|
color: var(--text-main);
|
|
border-color: rgba(255, 255, 255, 0.25);
|
|
background: rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.card-number {
|
|
position: absolute;
|
|
right: 1.5rem;
|
|
top: 1rem;
|
|
font-size: 3.5rem;
|
|
font-weight: 900;
|
|
color: rgba(255, 255, 255, 0.03);
|
|
line-height: 1;
|
|
user-select: none;
|
|
font-family: 'Outfit', sans-serif;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="container">
|
|
<!-- Success Banner -->
|
|
{% if success %}
|
|
<div class="success-banner">
|
|
<i class="bi bi-check-circle-fill" style="font-size: 1.75rem; color: var(--success-color);"></i>
|
|
<div>
|
|
<h5 class="mb-0 fw-bold">Votre vote a bien été enregistré !</h5>
|
|
<p class="mb-0" style="font-size: 0.9rem; opacity: 0.85;">Merci pour votre participation active au teambuilding.</p>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Header Block -->
|
|
<div class="glass-header">
|
|
<div class="card-number" style="left:1rem; right:auto; top:0.5rem;">FTB</div>
|
|
<h1 class="header-title">Résultats des Votes</h1>
|
|
<p class="header-subtitle">Visualisation en temps réel des avis exprimés sur le Flexi Teambuilding</p>
|
|
|
|
<div class="stats-summary d-inline-flex px-4 py-2 mt-2">
|
|
<div>
|
|
<div class="stats-number">{{ total_votes }}</div>
|
|
<div class="text-uppercase tracking-wider" style="font-size:0.75rem; color: var(--text-muted); font-weight:600; margin-top:2px;">
|
|
Participation{{ total_votes|pluralize }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Results Overview -->
|
|
<div class="results-container">
|
|
<h2 class="mb-4 pb-2 border-bottom border-secondary border-opacity-25 fw-bold" style="font-size: 1.6rem;">
|
|
Moyennes des évaluations
|
|
</h2>
|
|
|
|
{% if total_votes > 0 %}
|
|
<!-- GAEL -->
|
|
<div class="result-row">
|
|
<div class="proposal-name">1) La journée "Gaël Non Di Dju"</div>
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<div class="stars-avg" id="stars-gael" data-score="{{ avg_gael }}">
|
|
<!-- Star icons generated dynamically by JavaScript -->
|
|
<span class="score-badge">{{ avg_gael }} ★</span>
|
|
</div>
|
|
<div class="text-muted" style="font-size: 0.85rem;">{{ pct_gael }}% d'approbation</div>
|
|
</div>
|
|
<div class="custom-progress">
|
|
<div class="custom-progress-bar" style="width: 0%;" data-width="{{ pct_gael }}%"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- CHARLY -->
|
|
<div class="result-row">
|
|
<div class="proposal-name">2) La journée "La cité de Charly"</div>
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<div class="stars-avg" id="stars-charly" data-score="{{ avg_charly }}">
|
|
<span class="score-badge">{{ avg_charly }} ★</span>
|
|
</div>
|
|
<div class="text-muted" style="font-size: 0.85rem;">{{ pct_charly }}% d'approbation</div>
|
|
</div>
|
|
<div class="custom-progress">
|
|
<div class="custom-progress-bar" style="width: 0%;" data-width="{{ pct_charly }}%"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- TEQUILA -->
|
|
<div class="result-row">
|
|
<div class="proposal-name">3) La journée "Tequila Cadena"</div>
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<div class="stars-avg" id="stars-tequila" data-score="{{ avg_tequila }}">
|
|
<span class="score-badge">{{ avg_tequila }} ★</span>
|
|
</div>
|
|
<div class="text-muted" style="font-size: 0.85rem;">{{ pct_tequila }}% d'approbation</div>
|
|
</div>
|
|
<div class="custom-progress">
|
|
<div class="custom-progress-bar" style="width: 0%;" data-width="{{ pct_tequila }}%"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- VIVIEN -->
|
|
<div class="result-row">
|
|
<div class="proposal-name">4) La journée "Vivien de La Grande Propreté"</div>
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<div class="stars-avg" id="stars-vivien" data-score="{{ avg_vivien }}">
|
|
<span class="score-badge">{{ avg_vivien }} ★</span>
|
|
</div>
|
|
<div class="text-muted" style="font-size: 0.85rem;">{{ pct_vivien }}% d'approbation</div>
|
|
</div>
|
|
<div class="custom-progress">
|
|
<div class="custom-progress-bar" style="width: 0%;" data-width="{{ pct_vivien }}%"></div>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<div class="text-center py-5">
|
|
<i class="bi bi-chat-left-dots text-secondary mb-3" style="font-size: 3rem; display:block;"></i>
|
|
<h4 class="text-muted">Aucun vote n'a encore été enregistré.</h4>
|
|
<p class="text-muted mb-0">Soyez le premier à donner votre avis !</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Voters / Participants List -->
|
|
{% if total_votes > 0 %}
|
|
<div class="participants-card mb-5">
|
|
<h2 class="mb-4 pb-2 border-bottom border-secondary border-opacity-25 fw-bold" style="font-size: 1.6rem;">
|
|
Votants récents
|
|
</h2>
|
|
<div class="row">
|
|
{% for vote in votes %}
|
|
<div class="col-md-6 col-12">
|
|
<div class="participant-item">
|
|
<span class="fw-medium">
|
|
<i class="bi bi-person-circle me-2 text-info"></i>{{ vote.voter_name|default:"Votant Anonyme" }}
|
|
</span>
|
|
<span class="time">Voté le {{ vote.created_at|date:"d/m/Y à H:i" }}</span>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Actions block -->
|
|
<div class="text-center">
|
|
<a href="{% url 'home:flexi_teambuilding' %}" class="btn-action-back">
|
|
<i class="bi bi-arrow-left"></i> Retour au formulaire de vote
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Scripts for star calculation and progress bars animation -->
|
|
<script>
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
// Animate progress bars
|
|
setTimeout(() => {
|
|
const bars = document.querySelectorAll(".custom-progress-bar");
|
|
bars.forEach(bar => {
|
|
bar.style.width = bar.getAttribute("data-width");
|
|
});
|
|
}, 150);
|
|
|
|
// Generate stars representation for averages
|
|
const ids = ["stars-gael", "stars-charly", "stars-tequila", "stars-vivien"];
|
|
ids.forEach(id => {
|
|
const wrapper = document.getElementById(id);
|
|
if (!wrapper) return;
|
|
|
|
const score = parseFloat(wrapper.getAttribute("data-score")) || 0;
|
|
const badge = wrapper.querySelector(".score-badge");
|
|
|
|
// Clear wrapper content, keeping badge
|
|
wrapper.innerHTML = "";
|
|
|
|
// Build 3 stars
|
|
for (let i = 1; i <= 3; i++) {
|
|
const star = document.createElement("span");
|
|
if (i <= score) {
|
|
star.className = "star-icon bi bi-star-fill";
|
|
} else if (i - 0.5 <= score) {
|
|
star.className = "star-icon bi bi-star-half";
|
|
} else {
|
|
star.className = "star-icon empty bi bi-star";
|
|
}
|
|
wrapper.appendChild(star);
|
|
}
|
|
|
|
wrapper.appendChild(badge);
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|