Skip reveal phase and freeze titles after suggestions
This commit is contained in:
@@ -72,7 +72,6 @@ export function renderPhasePill() {
|
||||
);
|
||||
const viewMap = {
|
||||
Suggest: "suggest-view",
|
||||
Reveal: "reveal-view",
|
||||
Vote: "vote-view",
|
||||
Results: "results-view",
|
||||
};
|
||||
@@ -120,9 +119,7 @@ export function renderAllSuggestions() {
|
||||
if (!list) return;
|
||||
list.innerHTML = "";
|
||||
const allowEdit = !!state.me?.isAdmin;
|
||||
const allowDelete =
|
||||
!!state.me?.isAdmin &&
|
||||
(state.phase === "Reveal" || state.phase === "Suggest");
|
||||
const allowDelete = !!state.me?.isAdmin;
|
||||
state.allSuggestions.forEach((s) =>
|
||||
list.appendChild(
|
||||
buildCard(s, { showAuthor: true, allowEdit, allowDelete }),
|
||||
@@ -269,15 +266,8 @@ function buildResultMeta(r) {
|
||||
}
|
||||
|
||||
export function renderPhaseTitles() {
|
||||
const revealTitle = $("reveal-title");
|
||||
const voteTitle = $("vote-title");
|
||||
const totalGames = state.allSuggestions?.length ?? 0;
|
||||
if (revealTitle) {
|
||||
revealTitle.textContent =
|
||||
totalGames > 0
|
||||
? t("section.allSuggestions.count", { count: totalGames })
|
||||
: t("section.allSuggestions");
|
||||
}
|
||||
if (voteTitle) {
|
||||
voteTitle.textContent =
|
||||
totalGames > 0
|
||||
@@ -726,7 +716,6 @@ export function updatePhaseNav() {
|
||||
};
|
||||
|
||||
showNav("nav-suggest", phase === "Suggest");
|
||||
showNav("nav-reveal", phase === "Reveal");
|
||||
showNav("nav-vote", phase === "Vote");
|
||||
|
||||
const lockBadge = $("results-lock");
|
||||
@@ -737,7 +726,7 @@ export function updatePhaseNav() {
|
||||
}
|
||||
|
||||
// Toggle admin-only back buttons
|
||||
const backButtons = ["nav-reveal-prev", "nav-vote-prev"];
|
||||
const backButtons = ["nav-vote-prev"];
|
||||
backButtons.forEach((id) => {
|
||||
const btn = $(id);
|
||||
if (btn) btn.classList.toggle("hidden", !isAdmin);
|
||||
|
||||
Reference in New Issue
Block a user