aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarsVomMars2020-11-11 14:24:16 +0100
committerLarsVomMars2020-11-11 14:24:16 +0100
commit1f5fbac8fb0a75be7bde33c50818452d91fe781c (patch)
tree6b90fa9b38426b5786f1ca13f636ac90fa4e9587
parent8050da7e8c3229bc400023fe87767f43b7ead4ff (diff)
Run-off motto vote
-rw-r--r--mottovote/index.js2
-rw-r--r--mottovote/public/index.html6
-rw-r--r--mottovote/public/script.js2
3 files changed, 5 insertions, 5 deletions
diff --git a/mottovote/index.js b/mottovote/index.js
index c3dbb9b..73c1641 100644
--- a/mottovote/index.js
+++ b/mottovote/index.js
@@ -19,7 +19,7 @@ app.get("/api/list", checkUser, async (req, res) => {
app.put("/api/vote", checkUser, async (req, res) => {
await db.query("DELETE FROM motto_votes WHERE user_id = ?", [req.session.uid]);
try {
- if (Object.keys(req.body).length > 3) return res.send("error");
+ if (Object.keys(req.body).length > 1) return res.send("error");
for (const mid in req.body) {
await db.query("INSERT INTO motto_votes (user_id, motto_id, votes) VALUES (?, ?, ?)", [
req.session.uid,
diff --git a/mottovote/public/index.html b/mottovote/public/index.html
index 5aaa484..321433a 100644
--- a/mottovote/public/index.html
+++ b/mottovote/public/index.html
@@ -21,9 +21,9 @@
<main>
<p>
- Genaue Ausführungen, sowie Rechtschreibung, Gestaltung und Sub-Themen sind noch nach der Abstimmung
- diskutierbar. Ihr habt drei Stimmen, könnt euch nach der Wahl aber nochmal umentscheiden (ebenfalls über
- diese Seite). Bitte wählt vernünftig!
+ Da das Ergebnis recht knapp war, folgt hier noch eine kurze Stichwahl der beiden Top-Themen. Bitte wählt
+ vernünftig! Genaue Ausführungen, sowie Rechtschreibung, Gestaltung und Sub-Themen sind noch
+ diskutierbar.
</p>
<div id="vote"></div>
<button class="pure-button pure-button-primary" id="voteButton">Vote!</button>
diff --git a/mottovote/public/script.js b/mottovote/public/script.js
index 2a9f602..8e5e392 100644
--- a/mottovote/public/script.js
+++ b/mottovote/public/script.js
@@ -1,4 +1,4 @@
-const maxVotes = 3;
+const maxVotes = 1;
get();
async function get() {