mirror of
https://github.com/nfonteyne/octane-website.git
synced 2026-09-03 23:24:48 +02:00
update: better colors for calendar light mode and see rejected rehersal in calendar
This commit is contained in:
parent
a3d62200ce
commit
d0e9dfb62e
4 changed files with 55 additions and 18 deletions
|
|
@ -106,6 +106,7 @@ function concertLinksHtml(concert) {
|
|||
|
||||
function rehearsalStatusLabel(r) {
|
||||
if (r.status === 'confirmed') return 'Répétition confirmée';
|
||||
if (r.status === 'rejected') return 'Répétition refusée';
|
||||
const accepted = r.votes.filter((v) => v.vote === 'accept').length;
|
||||
return `Suggestion de répétition (${accepted}/${r.confirmThreshold} votes)`;
|
||||
}
|
||||
|
|
@ -216,10 +217,14 @@ function renderCalendar() {
|
|||
|
||||
const rehearsal = rehearsalsByDate.get(isoDate(date));
|
||||
if (rehearsal) {
|
||||
const isConfirmed = rehearsal.status === 'confirmed';
|
||||
cell.classList.add('has-rehearsal', isConfirmed ? 'rehearsal-confirmed' : 'rehearsal-suggested');
|
||||
const statusTitles = {
|
||||
confirmed: 'Répétition confirmée',
|
||||
rejected: 'Répétition refusée',
|
||||
suggested: 'Répétition proposée (en attente de votes)',
|
||||
};
|
||||
cell.classList.add('has-rehearsal', `rehearsal-${rehearsal.status}`);
|
||||
const badge = document.createElement('span');
|
||||
badge.title = isConfirmed ? 'Répétition confirmée' : 'Répétition proposée (en attente de votes)';
|
||||
badge.title = statusTitles[rehearsal.status] || statusTitles.suggested;
|
||||
badge.textContent = '🎸';
|
||||
badges.appendChild(badge);
|
||||
}
|
||||
|
|
@ -522,7 +527,7 @@ function rehearsalRowTemplate(r) {
|
|||
return `
|
||||
<div class="rehearsal-row" data-rehearsal-id="${r.id}">
|
||||
<div>
|
||||
<span class="vote-badge ${r.status === 'confirmed' ? 'accept' : ''}">${escapeHtml(rehearsalStatusLabel(r))}</span>
|
||||
<span class="vote-badge rehearsal-status-${r.status}">${escapeHtml(rehearsalStatusLabel(r))}</span>
|
||||
<div class="card-title">${formatDatetime(r.startsAt)} – ${formatTime(r.endsAt)}</div>
|
||||
<div class="card-subtitle">${r.location ? `${escapeHtml(r.location)} · ` : ''}Proposée par ${escapeHtml(r.proposedByName)}</div>
|
||||
${rehearsalAcceptedByHtml(r)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue