mirror of https://github.com/bra1n/townsquare.git
Merge pull request #83 from JulGvoz/main
voting, majority & passed clarified (closes #82)
This commit is contained in:
commit
8c87f696d5
|
@ -15,22 +15,42 @@
|
|||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Time</td>
|
||||
<td>Nominator</td>
|
||||
<td>Nominee</td>
|
||||
<td>Type</td>
|
||||
<td>Votes</td>
|
||||
<td>Majority</td>
|
||||
<td><font-awesome-icon icon="hand-paper" /> Hand up</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>{{ vote.majority }}</td>
|
||||
<td>
|
||||
{{ vote.votes.length }}
|
||||
<font-awesome-icon icon="user-friends" />
|
||||
<font-awesome-icon icon="hand-paper" />
|
||||
</td>
|
||||
<td>
|
||||
{{ vote.majority }}
|
||||
<font-awesome-icon
|
||||
:icon="[
|
||||
'fas',
|
||||
vote.votes.length >= vote.majority ? 'check-square' : 'square'
|
||||
]"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
{{ vote.votes.join(", ") }}
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -89,13 +109,16 @@ 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) {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue