From 4f298bbc8cdd476cc4c86cb7315ea340508ab42d Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Thu, 22 Jun 2023 09:41:41 +0100 Subject: [PATCH] userpage: add "back to admin" button --- css/base.css | 9 +++++++++ html/user.html | 1 + ts/user.ts | 3 +++ 3 files changed, 13 insertions(+) diff --git a/css/base.css b/css/base.css index 5599eb3..3376742 100644 --- a/css/base.css +++ b/css/base.css @@ -487,6 +487,15 @@ a:hover:not(.lang-link):not(.\~urge), a:active:not(.lang-link):not(.\~urge) { color: var(--color-urge-200); } +a.button, +a.button:link, +a.button:visited, +a.button:focus, +a.buton:hover { + color: var(--color-content) !important; +} + + .link-center { display: block; text-align: center; diff --git a/html/user.html b/html/user.html index c24eb83..3f78f8b 100644 --- a/html/user.html +++ b/html/user.html @@ -68,6 +68,7 @@ {{ .strings.logout }} + {{ .strings.admin }}
diff --git a/ts/user.ts b/ts/user.ts index 84e0867..ed71747 100644 --- a/ts/user.ts +++ b/ts/user.ts @@ -391,9 +391,12 @@ document.addEventListener("details-reload", () => { expiryCard.expiry = details.expiry; + const adminBackButton = document.getElementById("admin-back-button") as HTMLAnchorElement; + adminBackButton.href = window.location.href.replace("my/account", ""); let messageCard = document.getElementById("card-message"); if (details.accounts_admin) { + adminBackButton.classList.remove("unfocused"); if (typeof(messageCard) == "undefined" || messageCard == null) { messageCard = document.createElement("div"); messageCard.classList.add("card", "@low", "dark:~d_neutral", "content");