Actualiser js/admin.js
This commit is contained in:
+12
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user