From dfd469c66f89145524175dfc894dba1aab30b3ba Mon Sep 17 00:00:00 2001 From: Miguel Cabrerizo <30386061+doncicuto@users.noreply.github.com> Date: Thu, 10 Aug 2023 19:35:52 +0200 Subject: [PATCH] fix: go back to user selection from other user (#6255) * fix: go back to user selection from other user * fix: replace button with left arrow --- .../api/ui/login/static/resources/scripts/go_back.js | 12 ++++++++++++ internal/api/ui/login/static/templates/login.html | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 internal/api/ui/login/static/resources/scripts/go_back.js diff --git a/internal/api/ui/login/static/resources/scripts/go_back.js b/internal/api/ui/login/static/resources/scripts/go_back.js new file mode 100644 index 0000000000..6755145765 --- /dev/null +++ b/internal/api/ui/login/static/resources/scripts/go_back.js @@ -0,0 +1,12 @@ +document.getElementById("back-button").addEventListener("click", goBack); +document.getElementById("back-button").style.visibility = wereInUserSelection() + ? "visible" + : "hidden"; + +function goBack() { + history.back(); +} + +function wereInUserSelection() { + return window.location.href.includes("userselection"); +} diff --git a/internal/api/ui/login/static/templates/login.html b/internal/api/ui/login/static/templates/login.html index 33c81a005e..a8e0626eb4 100644 --- a/internal/api/ui/login/static/templates/login.html +++ b/internal/api/ui/login/static/templates/login.html @@ -33,6 +33,9 @@ {{template "error-message" .}}
+ + + {{if hasRegistration}} @@ -59,5 +62,6 @@ + {{template "main-bottom" .}}