Files
calminer/templates/partials/sidebar_nav.html
zwitschi 522b1e4105
Some checks failed
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / lint (push) Failing after 15s
CI / deploy (push) Has been skipped
feat: add scenarios list page with metrics and quick actions
- Introduced a new template for listing scenarios associated with a project.
- Added metrics for total, active, draft, and archived scenarios.
- Implemented quick actions for creating new scenarios and reviewing project overview.
- Enhanced navigation with breadcrumbs for better user experience.

refactor: update Opex and Profitability templates for consistency

- Changed titles and button labels for clarity in Opex and Profitability templates.
- Updated form IDs and action URLs for better alignment with new naming conventions.
- Improved navigation links to include scenario and project overviews.

test: add integration tests for Opex calculations

- Created new tests for Opex calculation HTML and JSON flows.
- Validated successful calculations and ensured correct data persistence.
- Implemented tests for currency mismatch and unsupported frequency scenarios.

test: enhance project and scenario route tests

- Added tests to verify scenario list rendering and calculator shortcuts.
- Ensured scenario detail pages link back to the portfolio correctly.
- Validated project detail pages show associated scenarios accurately.
2025-11-13 16:21:36 +01:00

79 lines
3.5 KiB
HTML

{% set sidebar_nav = get_sidebar_navigation(request) %}
{% set nav_groups = sidebar_nav.groups if sidebar_nav else [] %}
{% set current_path = request.url.path if request else '' %}
<nav
class="sidebar-nav"
aria-label="Primary navigation"
data-navigation-source="{{ 'server' if sidebar_nav else 'fallback' }}"
>
<div class="sidebar-nav-controls">
<button id="nav-prev" class="nav-chevron nav-chevron-prev" aria-label="Previous page"></button>
<button id="nav-next" class="nav-chevron nav-chevron-next" aria-label="Next page"></button>
</div>
{% if nav_groups %}
{% for group in nav_groups %}
{% if group.links %}
<div class="sidebar-section" data-group-id="{{ group.id }}">
<div class="sidebar-section-label">{{ group.label }}</div>
<div class="sidebar-section-links">
{% for link in group.links %}
{% set href = link.href %}
{% if href %}
{% set match_prefix = link.match_prefix or href %}
{% if match_prefix == '/' %}
{% set is_active = current_path == '/' %}
{% else %}
{% set is_active = current_path.startswith(match_prefix) %}
{% endif %}
<div class="sidebar-link-block" data-link-id="{{ link.id }}">
<a
href="{{ href }}"
class="sidebar-link{% if is_active %} is-active{% endif %}{% if link.is_external %} is-external{% endif %}"
data-match-prefix="{{ match_prefix }}"
{% if link.tooltip %}title="{{ link.tooltip }}"{% endif %}
{% if link.is_external %}target="_blank" rel="noopener noreferrer"{% endif %}
>
{{ link.label }}
</a>
{% if link.children %}
<div class="sidebar-sublinks">
{% for child in link.children %}
{% set child_href = child.href %}
{% if child_href %}
{% set child_prefix = child.match_prefix or child_href %}
{% if child_prefix == '/' %}
{% set child_active = current_path == '/' %}
{% else %}
{% set child_active = current_path.startswith(child_prefix) %}
{% endif %}
<a
href="{{ child_href }}"
class="sidebar-sublink{% if child_active %} is-active{% endif %}{% if child.is_external %} is-external{% endif %}"
data-match-prefix="{{ child_prefix }}"
{% if child.tooltip %}title="{{ child.tooltip }}"{% endif %}
{% if child.is_external %}target="_blank" rel="noopener noreferrer"{% endif %}
>
{{ child.label }}
</a>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}
{% else %}
<div class="sidebar-section sidebar-empty-state">
<div class="sidebar-section-label">Navigation</div>
<div class="sidebar-section-links">
<p class="sidebar-empty-copy">Navigation is unavailable.</p>
</div>
</div>
{% endif %}
</nav>