Show edit on own cards during voting; include playerId in listings
This commit is contained in:
@@ -19,6 +19,7 @@ public static class SuggestEndpoints
|
|||||||
.Select(s => new
|
.Select(s => new
|
||||||
{
|
{
|
||||||
s.Id,
|
s.Id,
|
||||||
|
s.PlayerId,
|
||||||
s.Name,
|
s.Name,
|
||||||
s.Genre,
|
s.Genre,
|
||||||
s.Description,
|
s.Description,
|
||||||
@@ -195,6 +196,7 @@ public static class SuggestEndpoints
|
|||||||
.Select(s => new
|
.Select(s => new
|
||||||
{
|
{
|
||||||
s.Id,
|
s.Id,
|
||||||
|
s.PlayerId,
|
||||||
s.Name,
|
s.Name,
|
||||||
s.Genre,
|
s.Genre,
|
||||||
s.Description,
|
s.Description,
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ export function signatureSuggestions(list) {
|
|||||||
return JSON.stringify(
|
return JSON.stringify(
|
||||||
list.map((s) => [
|
list.map((s) => [
|
||||||
s.id,
|
s.id,
|
||||||
|
s.playerId,
|
||||||
s.name,
|
s.name,
|
||||||
s.genre,
|
s.genre,
|
||||||
s.description,
|
s.description,
|
||||||
|
|||||||
@@ -136,9 +136,12 @@ export function renderVotes() {
|
|||||||
state.myVotes.map((v) => [v.suggestionId, v.score]),
|
state.myVotes.map((v) => [v.suggestionId, v.score]),
|
||||||
);
|
);
|
||||||
state.allSuggestions.forEach((s) => {
|
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, {
|
const li = buildCard(s, {
|
||||||
showAuthor: true,
|
showAuthor: true,
|
||||||
allowEdit: !!state.me?.isAdmin,
|
allowEdit: canEdit,
|
||||||
|
lockTitle,
|
||||||
});
|
});
|
||||||
const hasVote = Object.prototype.hasOwnProperty.call(votesMap, s.id);
|
const hasVote = Object.prototype.hasOwnProperty.call(votesMap, s.id);
|
||||||
const current = hasVote ? votesMap[s.id] : 5; // start neutral when no prior vote
|
const current = hasVote ? votesMap[s.id] : 5; // start neutral when no prior vote
|
||||||
|
|||||||
Reference in New Issue
Block a user