Organization tenancy and frontend #16

Merged
rixx merged 26 commits from 6-organizations into main 2025-03-21 12:32:53 +00:00
2 changed files with 24 additions and 1 deletions
Showing only changes of commit 1d4162582a - Show all commits

View file

@ -1,4 +1,4 @@
{% load i18n %}
{% load i18n static %}
<div id="sidebar">
<div id="sidebar">
<div class="sidebar-wrapper active">
@ -132,3 +132,4 @@
</div>
</div>
</div>
<script src="{% static 'js/sidebar.js' %}" defer></script>

View file

@ -0,0 +1,22 @@
/**
* This script marks the current path as active in the sidebar.
*/
document.addEventListener('DOMContentLoaded', () => {
const currentPath = window.location.pathname;
const sidebarLinks = document.querySelectorAll('.sidebar-link');
sidebarLinks.forEach(link => {
// Skip links that are inside buttons (like logout)
if (link.tagName === 'BUTTON') return;
if (link.getAttribute('href') === currentPath) {
const parentItem = link.closest('.sidebar-item');
if (parentItem) {
parentItem.classList.add('active');
} else {
link.classList.add('active');
}
}
})
})