Actualiser js/admin.js

This commit is contained in:
2026-06-19 20:31:25 +02:00
parent 67e6f679b6
commit b8f53c68f9
+12
View File
@@ -5,6 +5,18 @@ let currentPage = 1;
const itemsPerPage = 12;
let searchQuery = '';
// ── GÉNÉRATEUR D'ÉTOILES (Supporte les demi-étoiles) ─
function getStarsHTML(rating) {
const r = parseFloat(rating) || 0;
const full = Math.floor(r);
const hasHalf = (r - full) >= 0.5;
const empty = 5 - Math.ceil(r);
let html = '★'.repeat(full);
if (hasHalf) html += '<span class="half-star">★</span>';
html += `<span class="stars-muted">${'☆'.repeat(empty)}</span>`;
return html;
}
// ── INITIALISATION ──
document.addEventListener('DOMContentLoaded', () => {
loadDashboardData();