Merge pull request #1 from bra1n/JulGvoz/main

PR feedback
This commit is contained in:
JulGvoz 2021-01-09 16:23:51 +02:00 committed by GitHub
commit c7b251a4a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 14 deletions

View File

@ -15,31 +15,43 @@
<table>
<thead>
<tr>
<td>Time</td>
<td>Nominator</td>
<td>Nominee</td>
<td>Type</td>
<td>Votes</td>
<td><font-awesome-icon icon="hand-paper" /> Hand up</td>
<td>Majority</td>
<td>
<font-awesome-icon icon="user-friends" />
Voters
</td>
</tr>
</thead>
<tbody>
<tr v-for="(vote, index) in session.voteHistory" :key="index">
<td>
{{ vote.timestamp.getHours().toString().padStart(2, "0") }}:{{
vote.timestamp.getMinutes().toString().padStart(2, "0")
}}
</td>
<td>{{ vote.nominator }}</td>
<td>{{ vote.nominee }}</td>
<td>{{ vote.type }}</td>
<td><strong>{{ vote.votes.length }}</strong></td>
<td>
<font-awesome-icon icon="user-friends" />
{{ vote.votes.join(", ") }}
{{ vote.votes.length }}
<font-awesome-icon icon="hand-paper" />
</td>
<td>
<template v-if="vote.votes.length >= vote.majority">
<font-awesome-icon icon="check-square" /> ({{ vote.majority }})
</template>
<template v-else>
<font-awesome-icon icon="square" /> ({{ vote.majority }})
</template>
{{ vote.majority }}
<font-awesome-icon
:icon="[
'fas',
vote.votes.length >= vote.majority ? 'check-square' : 'square'
]"
/>
</td>
<td>
{{ vote.votes.join(", ") }}
</td>
</tr>
</tbody>
@ -97,13 +109,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) {

View File

@ -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",