Add admin vote status list and ready/wait messaging
This commit is contained in:
@@ -653,6 +653,27 @@ function missingVotesCount() {
|
||||
return missing < 0 ? 0 : missing;
|
||||
}
|
||||
|
||||
function renderAdminVoteStatus() {
|
||||
if (!state.me?.isAdmin) return;
|
||||
const list = $("admin-voter-list");
|
||||
const status = $("admin-ready-status");
|
||||
if (!state.adminVoteStatus || !list || !status) return;
|
||||
|
||||
list.innerHTML = "";
|
||||
state.adminVoteStatus.voters.forEach((v) => {
|
||||
const li = document.createElement("li");
|
||||
li.textContent = `${v.name} — ${v.finalized ? "✅" : "⏳"}`;
|
||||
list.appendChild(li);
|
||||
});
|
||||
|
||||
const waiting = state.adminVoteStatus.waiting;
|
||||
const ready = waiting.length === 0;
|
||||
status.textContent = ready
|
||||
? t("admin.readyForResults")
|
||||
: t("admin.waitingForPlayers", { names: waiting.join(", ") });
|
||||
status.className = ready ? "badge" : "badge warning";
|
||||
}
|
||||
|
||||
function openDeleteConfirmModal(s) {
|
||||
const overlay = document.createElement("div");
|
||||
overlay.className = "edit-modal";
|
||||
@@ -762,6 +783,8 @@ export function updatePhaseNav() {
|
||||
voteStatusText.textContent = state.votesFinal ? t("nav.voteFinalized") : t("nav.voteHint");
|
||||
}
|
||||
|
||||
renderAdminVoteStatus();
|
||||
|
||||
// Toggle admin-only back buttons
|
||||
const backButtons = ["nav-vote-prev"];
|
||||
backButtons.forEach((id) => {
|
||||
|
||||
Reference in New Issue
Block a user