1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-22 17:10:10 +00:00

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
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2
3 changed files with 13 additions and 0 deletions

View File

@ -487,6 +487,15 @@ a:hover:not(.lang-link):not(.\~urge), a:active:not(.lang-link):not(.\~urge) {
color: var(--color-urge-200); 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 { .link-center {
display: block; display: block;
text-align: center; text-align: center;

View File

@ -68,6 +68,7 @@
</span> </span>
<span class="button ~warning" alt="{{ .strings.theme }}" id="button-theme"><i class="ri-sun-line"></i></span> <span class="button ~warning" alt="{{ .strings.theme }}" id="button-theme"><i class="ri-sun-line"></i></span>
<span class="button ~critical @low mb-4 unfocused" id="logout-button">{{ .strings.logout }}</span> <span class="button ~critical @low mb-4 unfocused" id="logout-button">{{ .strings.logout }}</span>
<a class="button ~info unfocused" href="/" id="admin-back-button"><i class="ri-arrow-left-fill mr-2"></i>{{ .strings.admin }}</a>
</div> </div>
<div class="page-container unfocused"> <div class="page-container unfocused">
<div class="card @low dark:~d_neutral mb-4" id="card-user"> <div class="card @low dark:~d_neutral mb-4" id="card-user">

View File

@ -391,9 +391,12 @@ document.addEventListener("details-reload", () => {
expiryCard.expiry = details.expiry; 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"); let messageCard = document.getElementById("card-message");
if (details.accounts_admin) { if (details.accounts_admin) {
adminBackButton.classList.remove("unfocused");
if (typeof(messageCard) == "undefined" || messageCard == null) { if (typeof(messageCard) == "undefined" || messageCard == null) {
messageCard = document.createElement("div"); messageCard = document.createElement("div");
messageCard.classList.add("card", "@low", "dark:~d_neutral", "content"); messageCard.classList.add("card", "@low", "dark:~d_neutral", "content");