Files
calminer/static/js/navigation.js
zwitschi acf6f50bbd
Some checks failed
CI / lint (push) Successful in 15s
CI / build (push) Has been skipped
CI / test (push) Failing after 17s
CI / deploy (push) Has been skipped
feat: Add NPV comparison and distribution charts to reporting
- Implemented NPV comparison chart generation using Plotly in ReportingService.
- Added distribution histogram for Monte Carlo results.
- Updated reporting templates to include new charts and improved layout.
- Created new settings and currencies management pages.
- Enhanced sidebar navigation with dynamic URL handling.
- Improved CSS styles for chart containers and overall layout.
- Added new simulation and theme settings pages with placeholders for future features.
2025-11-12 19:39:27 +01:00

54 lines
1.3 KiB
JavaScript

// Navigation chevron buttons logic
document.addEventListener("DOMContentLoaded", function () {
const navPrev = document.getElementById("nav-prev");
const navNext = document.getElementById("nav-next");
if (!navPrev || !navNext) return;
// Define the navigation order (main pages)
const navPages = [
window.NAVIGATION_URLS.dashboard,
window.NAVIGATION_URLS.projects,
window.NAVIGATION_URLS.imports,
window.NAVIGATION_URLS.simulations,
window.NAVIGATION_URLS.reporting,
window.NAVIGATION_URLS.settings,
];
const currentPath = window.location.pathname;
// Find current index
let currentIndex = -1;
for (let i = 0; i < navPages.length; i++) {
if (currentPath.startsWith(navPages[i])) {
currentIndex = i;
break;
}
}
// If not found, disable both
if (currentIndex === -1) {
navPrev.disabled = true;
navNext.disabled = true;
return;
}
// Set up prev button
if (currentIndex > 0) {
navPrev.addEventListener("click", function () {
window.location.href = navPages[currentIndex - 1];
});
} else {
navPrev.disabled = true;
}
// Set up next button
if (currentIndex < navPages.length - 1) {
navNext.addEventListener("click", function () {
window.location.href = navPages[currentIndex + 1];
});
} else {
navNext.disabled = true;
}
});