From 6cd15dfb33eab0fe20df5b1fa7a04fb70381e6d4 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Sat, 26 Mar 2022 22:53:18 +0100 Subject: [PATCH] Fix info page layout --- Public/festival/assets/festival.css | 1 + Public/festival/assets/festival.js | 15 ++++++++++++--- Public/festival/info.html | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Public/festival/assets/festival.css b/Public/festival/assets/festival.css index 167ac79..1438549 100644 --- a/Public/festival/assets/festival.css +++ b/Public/festival/assets/festival.css @@ -275,6 +275,7 @@ input[type=text] { max-width: 800px; padding: 0 20px; height: 100%; + margin: 0 auto; } .content-grid { diff --git a/Public/festival/assets/festival.js b/Public/festival/assets/festival.js index e762d30..58582d9 100644 --- a/Public/festival/assets/festival.js +++ b/Public/festival/assets/festival.js @@ -1,5 +1,8 @@ var isPlaying = false; +registeredName = localStorage.getItem('name'); +didAcceptInvitation = localStorage.getItem('registered'); + var currentLang = 'de'; if (window.navigator.language != 'de') { currentLang = 'en'; @@ -61,18 +64,24 @@ async function participate(isParticipating) { document.getElementById("name-form").style.display = 'none' document.getElementById("info-button").style.display = 'inherit' console.log("Registering: " + name); + localStorage.removeItem('name'); + localStorage.removeItem('registered'); if (isParticipating) { let registered = await performRequest(name, "register") if (registered) { - document.getElementById("registered-text").style.display = 'inherit' - document.getElementById("add-calender-event").style.display = 'inherit' + document.getElementById("registered-text").style.display = 'inherit'; + document.getElementById("add-calender-event").style.display = 'inherit'; + localStorage.setItem('name', name); + localStorage.setItem('registered', 'true'); } else { document.getElementById("error-text").style.display = 'inherit' } } else { let declined = await performRequest(name, "decline") if (declined) { - document.getElementById("declined-text").style.display = 'inherit' + document.getElementById("declined-text").style.display = 'inherit'; + localStorage.setItem('name', name); + localStorage.setItem('registered', 'false'); } else { document.getElementById("error-text").style.display = 'inherit' } diff --git a/Public/festival/info.html b/Public/festival/info.html index de0b0bb..c0cd71e 100644 --- a/Public/festival/info.html +++ b/Public/festival/info.html @@ -16,7 +16,7 @@ - + @@ -41,7 +41,7 @@