userpage: add "back to admin" button

This commit is contained in:
Harvey Tindall
2023-06-22 09:41:41 +01:00
parent 8113f794ab
commit 4f298bbc8c
3 changed files with 13 additions and 0 deletions
+3
View File
@@ -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");