diff --git a/src/templates/src/user_settings.html b/src/templates/src/user_settings.html index 372e6973..41497f35 100644 --- a/src/templates/src/user_settings.html +++ b/src/templates/src/user_settings.html @@ -7,18 +7,14 @@ {{ define "content" }}
-
-
- +
+ -
+
{{ csrftoken .Session }} @@ -189,194 +185,29 @@ let panels = document.querySelectorAll(".settings_panel"); let found = false; + let slug = ""; for (let i = 0; i < panels.length; ++i) { visible = hash == panels[i].dataset.slug; panels[i].hidden = !visible; if (visible) { + slug = panels[i].dataset.slug; found = true; } } if (!found) { + slug = panels[0].dataset.slug; panels[0].hidden = false; } + + let tabs = document.querySelectorAll(".tab-button"); + for (let i = 0; i < tabs.length; ++i) { + tabs[i].classList.toggle("tab-button-active", tabs[i].getAttribute("href").slice(1) == slug); + } } window.addEventListener("hashchange", updateVisibleSettings); updateVisibleSettings(); - {{ csrftoken .Session }}