Make edit modal match add form layout with labeled fields
This commit is contained in:
@@ -534,9 +534,18 @@ function openEditModal(s) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="edit-body">
|
<div class="edit-body">
|
||||||
<form class="stack" id="edit-form">
|
<form class="stack" id="edit-form">
|
||||||
<input name="name" required maxlength="100" placeholder="${t("form.placeholder.gameName")}" value="${s.name ?? ""}" />
|
<label class="stack">
|
||||||
<input name="genre" maxlength="50" placeholder="${t("form.placeholder.genre")}" value="${s.genre ?? ""}" />
|
<span class="label" data-i18n="form.gameName">${t("form.gameName")}</span>
|
||||||
<textarea name="description" maxlength="500" placeholder="${t("form.placeholder.description")}">${s.description ?? ""}</textarea>
|
<input name="name" required maxlength="100" value="${s.name ?? ""}" />
|
||||||
|
</label>
|
||||||
|
<label class="stack">
|
||||||
|
<span class="label" data-i18n="form.genre">${t("form.genre")}</span>
|
||||||
|
<input name="genre" maxlength="50" value="${s.genre ?? ""}" />
|
||||||
|
</label>
|
||||||
|
<label class="stack">
|
||||||
|
<span class="label" data-i18n="form.description">${t("form.description")}</span>
|
||||||
|
<textarea name="description" maxlength="500">${s.description ?? ""}</textarea>
|
||||||
|
</label>
|
||||||
<div class="stack">
|
<div class="stack">
|
||||||
<span class="label">${t("form.players")}</span>
|
<span class="label">${t("form.players")}</span>
|
||||||
<div class="stack horizontal">
|
<div class="stack horizontal">
|
||||||
@@ -550,11 +559,18 @@ function openEditModal(s) {
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stack horizontal">
|
<label class="stack">
|
||||||
<input name="screenshotUrl" maxlength="2048" placeholder="${t("form.placeholder.screenshot")}" value="${s.screenshotUrl ?? ""}" />
|
<span class="label" data-i18n="form.screenshot">${t("form.screenshot")}</span>
|
||||||
<input name="youtubeUrl" maxlength="2048" placeholder="${t("form.placeholder.youtube")}" value="${s.youtubeUrl ?? ""}" />
|
<input name="screenshotUrl" maxlength="2048" value="${s.screenshotUrl ?? ""}" />
|
||||||
<input name="gameUrl" maxlength="2048" placeholder="${t("form.placeholder.gameUrl")}" value="${s.gameUrl ?? ""}" />
|
</label>
|
||||||
</div>
|
<label class="stack">
|
||||||
|
<span class="label" data-i18n="form.youtube">${t("form.youtube")}</span>
|
||||||
|
<input name="youtubeUrl" maxlength="2048" value="${s.youtubeUrl ?? ""}" />
|
||||||
|
</label>
|
||||||
|
<label class="stack">
|
||||||
|
<span class="label" data-i18n="form.gameUrl">${t("form.gameUrl")}</span>
|
||||||
|
<input name="gameUrl" maxlength="2048" value="${s.gameUrl ?? ""}" />
|
||||||
|
</label>
|
||||||
<div class="stack horizontal">
|
<div class="stack horizontal">
|
||||||
<button type="submit">${t("modal.save")}</button>
|
<button type="submit">${t("modal.save")}</button>
|
||||||
<button type="button" class="ghost" id="edit-cancel">${t("modal.cancel")}</button>
|
<button type="button" class="ghost" id="edit-cancel">${t("modal.cancel")}</button>
|
||||||
@@ -661,10 +677,10 @@ function normalizeSuggestionForm(formData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function scoreToEmoji(score) {
|
function scoreToEmoji(score) {
|
||||||
if (score <= 1) return "😡";
|
if (score < 1) return "😡";
|
||||||
if (score <= 3) return "😠";
|
if (score <= 3) return "😠";
|
||||||
if (score <= 5) return "😐";
|
if (score <= 6) return "😐";
|
||||||
if (score <= 7) return "🙂";
|
if (score <= 8) return "🙂";
|
||||||
if (score <= 8) return "😃";
|
if (score <= 9) return "😃";
|
||||||
return "🤩";
|
return "🤩";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ const translations = {
|
|||||||
"counts.format": "Players: {players} • Suggestions: {suggestions} • Votes: {votes}",
|
"counts.format": "Players: {players} • Suggestions: {suggestions} • Votes: {votes}",
|
||||||
|
|
||||||
"suggest.title": "Suggest (up to 5)",
|
"suggest.title": "Suggest (up to 5)",
|
||||||
|
"suggest.new": "Add new suggestion",
|
||||||
"suggest.hint": "Only you can see your suggestions until Reveal.",
|
"suggest.hint": "Only you can see your suggestions until Reveal.",
|
||||||
"form.gameName": "Game name *",
|
"form.gameName": "Game name *",
|
||||||
"form.genre": "Genre",
|
"form.genre": "Genre",
|
||||||
@@ -126,6 +127,7 @@ const translations = {
|
|||||||
"counts.format": "Spieler: {players} • Vorschläge: {suggestions} • Stimmen: {votes}",
|
"counts.format": "Spieler: {players} • Vorschläge: {suggestions} • Stimmen: {votes}",
|
||||||
|
|
||||||
"suggest.title": "Vorschlagen (bis zu 5)",
|
"suggest.title": "Vorschlagen (bis zu 5)",
|
||||||
|
"suggest.new": "Neuen Vorschlag hinzufügen",
|
||||||
"suggest.hint": "Nur du siehst deine Vorschläge bis zur Enthüllung.",
|
"suggest.hint": "Nur du siehst deine Vorschläge bis zur Enthüllung.",
|
||||||
"form.gameName": "Spielname *",
|
"form.gameName": "Spielname *",
|
||||||
"form.genre": "Genre",
|
"form.genre": "Genre",
|
||||||
|
|||||||
Reference in New Issue
Block a user