From 52dedd1e7c3d9ab62d98bbc4bb67f0cb7568087a Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 15:39:11 +0200 Subject: [PATCH] Renamed all references to ballot to raffle. --- api/virtualLottery.js | 16 +++++----- src/components/GeneratePage.vue | 6 ++-- .../VirtualLotteryRegistrationPage.vue | 30 +++++++++---------- src/styles/global.scss | 10 +++---- src/ui/Attendees.vue | 10 +++---- src/ui/TotalBought.vue | 8 ++--- src/ui/WinnerDraw.vue | 10 +++---- src/ui/Winners.vue | 4 +-- 8 files changed, 47 insertions(+), 47 deletions(-) diff --git a/api/virtualLottery.js b/api/virtualLottery.js index 81107dc..e9ec85f 100644 --- a/api/virtualLottery.js +++ b/api/virtualLottery.js @@ -45,7 +45,7 @@ const attendees = async (req, res) => { attendee = attendees[i]; attendeesRedacted.push({ name: attendee.name, - ballots: attendee.red + attendee.blue + attendee.yellow + attendee.green, + raffles: attendee.red + attendee.blue + attendee.yellow + attendee.green, red: attendee.red, blue: attendee.blue, green: attendee.green, @@ -99,27 +99,27 @@ const drawWinner = async (req, res) => { message: "No attendees left that have not won." }); } - let ballotColors = []; + let raffleColors = []; for (let i = 0; i < allContestants.length; i++) { let currentContestant = allContestants[i]; for (let blue = 0; blue < currentContestant.blue; blue++) { - ballotColors.push("blue"); + raffleColors.push("blue"); } for (let red = 0; red < currentContestant.red; red++) { - ballotColors.push("red"); + raffleColors.push("red"); } for (let green = 0; green < currentContestant.green; green++) { - ballotColors.push("green"); + raffleColors.push("green"); } for (let yellow = 0; yellow < currentContestant.yellow; yellow++) { - ballotColors.push("yellow"); + raffleColors.push("yellow"); } } - ballotColors = shuffle(ballotColors); + raffleColors = shuffle(raffleColors); let colorToChooseFrom = - ballotColors[Math.floor(Math.random() * ballotColors.length)]; + raffleColors[Math.floor(Math.random() * raffleColors.length)]; let findObject = { winner: false }; findObject[colorToChooseFrom] = { $gt: 0 }; diff --git a/src/components/GeneratePage.vue b/src/components/GeneratePage.vue index a77e780..e149888 100644 --- a/src/components/GeneratePage.vue +++ b/src/components/GeneratePage.vue @@ -5,9 +5,9 @@ Velg hvilke farger du vil ha, fyll inn antall lodd og klikk 'generer'

- + - + @@ -27,7 +27,7 @@ export default { data() { return { hardStart: false, - numberOfBallots: null + numberOfRaffles: null }; }, mounted() { diff --git a/src/components/VirtualLotteryRegistrationPage.vue b/src/components/VirtualLotteryRegistrationPage.vue index cff8fe8..153c6e9 100644 --- a/src/components/VirtualLotteryRegistrationPage.vue +++ b/src/components/VirtualLotteryRegistrationPage.vue @@ -18,7 +18,7 @@

Vinnere

-
+
{{ winner.name }} {{ winner.phoneNumber }} Rød: {{ winner.red }} @@ -47,11 +47,11 @@ {{ attendee.name }} {{ attendee.phoneNumber }}
-
-
{{ attendee.red }}
-
{{ attendee.blue }}
-
{{ attendee.green }}
-
{{ attendee.yellow }}
+
+
{{ attendee.red }}
+
{{ attendee.blue }}
+
{{ attendee.green }}
+
{{ attendee.yellow }}
@@ -140,7 +140,7 @@ export default { blue: 0, green: 0, yellow: 0, - ballots: 0, + raffles: 0, randomColors: false, attendees: [], winners: [], @@ -197,7 +197,7 @@ export default { blue: this.blue, green: this.green, yellow: this.yellow, - ballots: this.ballots + raffles: this.raffles }); if (response == true) { @@ -354,7 +354,7 @@ hr { } } -.ballot-element { +.raffle-element { width: 140px; height: 150px; margin: 20px 0; @@ -378,19 +378,19 @@ hr { font-size: 1rem; } - &.green-ballot { + &.green-raffle { background-color: $light-green; } - &.blue-ballot { + &.blue-raffle { background-color: $light-blue; } - &.yellow-ballot { + &.yellow-raffle { background-color: $light-yellow; } - &.red-ballot { + &.red-raffle { background-color: $light-red; } } @@ -422,7 +422,7 @@ button { margin: 0 auto; & .name-and-phone, - & .ballots-container { + & .raffles-container { display: flex; justify-content: center; } @@ -431,7 +431,7 @@ button { flex-direction: column; } - & .ballots-container { + & .raffles-container { flex-direction: row; } } diff --git a/src/styles/global.scss b/src/styles/global.scss index d4bbfce..5a76392 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -199,7 +199,7 @@ textarea { margin: 0 !important; } -.ballot-element { +.raffle-element { margin: 20px 0; -webkit-mask-image: url(/../../public/assets/images/lodd.svg); background-repeat: no-repeat; @@ -208,19 +208,19 @@ textarea { mask-repeat: no-repeat; color: #333333; - &.green-ballot { + &.green-raffle { background-color: $light-green; } - &.blue-ballot { + &.blue-raffle { background-color: $light-blue; } - &.yellow-ballot { + &.yellow-raffle { background-color: $light-yellow; } - &.red-ballot { + &.red-raffle { background-color: $light-red; } } diff --git a/src/ui/Attendees.vue b/src/ui/Attendees.vue index 6b6b819..92f4a64 100644 --- a/src/ui/Attendees.vue +++ b/src/ui/Attendees.vue @@ -4,10 +4,10 @@
{{ attendee.name }} -
{{ attendee.red }}
-
{{ attendee.blue }}
-
{{ attendee.green }}
-
{{ attendee.yellow }}
+
{{ attendee.red }}
+
{{ attendee.blue }}
+
{{ attendee.green }}
+
{{ attendee.yellow }}
@@ -46,7 +46,7 @@ export default { width: 60%; } -.ballot-element { +.raffle-element { font-size: 0.75rem; width: 45px; height: 45px; diff --git a/src/ui/TotalBought.vue b/src/ui/TotalBought.vue index 217cd84..4d1f936 100644 --- a/src/ui/TotalBought.vue +++ b/src/ui/TotalBought.vue @@ -8,7 +8,7 @@ color.name + '-container ' + color.name + - '-ballot inner-bought-container ballot-element' + '-raffle inner-bought-container raffle-element' " :key="color.name" > @@ -24,7 +24,7 @@
-
+
Totalt 
@@ -136,7 +136,7 @@ export default { align-items: center; } -.ballot-element { +.raffle-element { width: 140px; height: 150px; margin: 20px 0; @@ -166,7 +166,7 @@ export default { } } -.total-ballots { +.total-raffles { width: 150px; height: 150px; margin: 20px 0; diff --git a/src/ui/WinnerDraw.vue b/src/ui/WinnerDraw.vue index 1cd3d8d..81c04ec 100644 --- a/src/ui/WinnerDraw.vue +++ b/src/ui/WinnerDraw.vue @@ -3,8 +3,8 @@

TREKKER

{{ currentName }} @@ -19,8 +19,8 @@

VINNER

{{ currentName }} @@ -204,7 +204,7 @@ h2 { align-items: center; } -.ballot-element { +.raffle-element { width: 140px; height: 140px; font-size: 1.2rem; diff --git a/src/ui/Winners.vue b/src/ui/Winners.vue index fc76fd6..238c955 100644 --- a/src/ui/Winners.vue +++ b/src/ui/Winners.vue @@ -3,7 +3,7 @@

{{ title ? title : 'Vinnere' }}

-
{{ winner.name }}
+
{{ winner.name }}
@@ -40,7 +40,7 @@ h2 { flex-wrap: wrap; } -.ballot-element { +.raffle-element { font-size: 1rem; width: 145px; height: 145px;