81 lines
2.8 KiB
HTML
81 lines
2.8 KiB
HTML
{% set dashboard_href = request.url_for('dashboard.home') if request else '/' %}
|
|
{% set projects_href = request.url_for('projects.project_list_page') if request else '/projects/ui' %}
|
|
{% set project_create_href = request.url_for('projects.create_project_form') if request else '/projects/create' %}
|
|
|
|
{% set nav_groups = [
|
|
{
|
|
"label": "Workspace",
|
|
"links": [
|
|
{"href": dashboard_href, "label": "Dashboard", "match_prefix": "/"},
|
|
{"href": projects_href, "label": "Projects", "match_prefix": "/projects"},
|
|
{"href": project_create_href, "label": "New Project", "match_prefix": "/projects/create"},
|
|
],
|
|
},
|
|
{
|
|
"label": "Insights",
|
|
"links": [
|
|
{"href": "/ui/simulations", "label": "Simulations"},
|
|
{"href": "/ui/reporting", "label": "Reporting"},
|
|
],
|
|
},
|
|
{
|
|
"label": "Configuration",
|
|
"links": [
|
|
{
|
|
"href": "/ui/settings",
|
|
"label": "Settings",
|
|
"children": [
|
|
{"href": "/theme-settings", "label": "Themes"},
|
|
{"href": "/ui/currencies", "label": "Currency Management"},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
] %}
|
|
|
|
<nav class="sidebar-nav" aria-label="Primary navigation">
|
|
{% set current_path = request.url.path if request else "" %}
|
|
{% for group in nav_groups %}
|
|
<div class="sidebar-section">
|
|
<div class="sidebar-section-label">{{ group.label }}</div>
|
|
<div class="sidebar-section-links">
|
|
{% for link in group.links %}
|
|
{% set href = link.href %}
|
|
{% set match_prefix = link.get('match_prefix', href) %}
|
|
{% if match_prefix == '/' %}
|
|
{% set is_active = current_path == '/' %}
|
|
{% else %}
|
|
{% set is_active = current_path.startswith(match_prefix) %}
|
|
{% endif %}
|
|
<div class="sidebar-link-block">
|
|
<a
|
|
href="{{ href }}"
|
|
class="sidebar-link{% if is_active %} is-active{% endif %}"
|
|
>
|
|
{{ link.label }}
|
|
</a>
|
|
{% if link.children %}
|
|
<div class="sidebar-sublinks">
|
|
{% for child in link.children %}
|
|
{% set child_prefix = child.get('match_prefix', 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 %}"
|
|
>
|
|
{{ child.label }}
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</nav>
|