Show edit on own cards during voting; include playerId in listings

This commit is contained in:
2026-02-04 22:19:49 +01:00
parent aaeb6a7c44
commit 8602f61ff4
3 changed files with 7 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ public static class SuggestEndpoints
.Select(s => new
{
s.Id,
s.PlayerId,
s.Name,
s.Genre,
s.Description,
@@ -195,6 +196,7 @@ public static class SuggestEndpoints
.Select(s => new
{
s.Id,
s.PlayerId,
s.Name,
s.Genre,
s.Description,

View File

@@ -78,6 +78,7 @@ export function signatureSuggestions(list) {
return JSON.stringify(
list.map((s) => [
s.id,
s.playerId,
s.name,
s.genre,
s.description,

View File

@@ -136,9 +136,12 @@ export function renderVotes() {
state.myVotes.map((v) => [v.suggestionId, v.score]),
);
state.allSuggestions.forEach((s) => {
const canEdit = !!state.me?.isAdmin || s.playerId === state.me?.id;
const lockTitle = state.phase !== "Suggest" && !state.me?.isAdmin;
const li = buildCard(s, {
showAuthor: true,
allowEdit: !!state.me?.isAdmin,
allowEdit: canEdit,
lockTitle,
});
const hasVote = Object.prototype.hasOwnProperty.call(votesMap, s.id);
const current = hasVote ? votesMap[s.id] : 5; // start neutral when no prior vote