From be89d51ae639e8910083eab6748735eab1ba7549 Mon Sep 17 00:00:00 2001 From: Steffen Date: Thu, 7 Jan 2021 20:25:12 +0100 Subject: [PATCH] added vote time --- src/components/modals/VoteHistoryModal.vue | 29 +++++++++++++++------- src/store/modules/session.js | 2 +- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/components/modals/VoteHistoryModal.vue b/src/components/modals/VoteHistoryModal.vue index e9ba001..4af0360 100644 --- a/src/components/modals/VoteHistoryModal.vue +++ b/src/components/modals/VoteHistoryModal.vue @@ -15,31 +15,42 @@ + - + + - +
Time Nominator Nominee Type Votes Hand up Majority + + Voters +
+ {{ vote.timestamp.getHours() }}:{{ vote.timestamp.getMinutes() }} + {{ vote.nominator }} {{ vote.nominee }} {{ vote.type }}{{ vote.votes.length }} - - {{ vote.votes.join(", ") }} + {{ vote.votes.length }} + {{ vote.majority }} + {{ vote.votes.join(", ") }} +
@@ -96,13 +107,13 @@ thead td { } tbody { - td:nth-child(1) { + td:nth-child(2) { color: $townsfolk; } - td:nth-child(2) { + td:nth-child(3) { color: $demon; } - td:nth-child(4) { + td:nth-child(5) { text-align: center; } td:nth-child(6) { diff --git a/src/store/modules/session.js b/src/store/modules/session.js index 152eba6..62dda3c 100644 --- a/src/store/modules/session.js +++ b/src/store/modules/session.js @@ -72,8 +72,8 @@ const mutations = { addHistory(state, players) { if (!state.nomination || state.lockedVote <= players.length) return; const isBanishment = players[state.nomination[1]].role.team === "traveler"; - console.log(isBanishment); state.voteHistory.push({ + timestamp: new Date(), nominator: players[state.nomination[0]].name, nominee: players[state.nomination[1]].name, type: isBanishment ? "Banishment" : "Execution",