{% 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 auth_session = request.state.auth_session if request else None %} {% set is_authenticated = auth_session and auth_session.is_authenticated %} {% if is_authenticated %} {% set logout_href = request.url_for('auth.logout') if request else '/logout' %} {% set account_links = [ {"href": logout_href, "label": "Logout", "match_prefix": "/logout"} ] %} {% else %} {% set login_href = request.url_for('auth.login_form') if request else '/login' %} {% set register_href = request.url_for('auth.register_form') if request else '/register' %} {% set forgot_href = request.url_for('auth.password_reset_request_form') if request else '/forgot-password' %} {% set account_links = [ {"href": login_href, "label": "Login", "match_prefix": "/login"}, {"href": register_href, "label": "Register", "match_prefix": "/register"}, {"href": forgot_href, "label": "Forgot Password", "match_prefix": "/forgot-password"} ] %} {% endif %} {% 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"}, {"href": "/imports/ui", "label": "Imports", "match_prefix": "/imports"}, {"href": request.url_for('calculations.profitability_form') if request else '/calculations/profitability', "label": "Profitability Calculator", "match_prefix": "/calculations/profitability"}, {"href": request.url_for('calculations.processing_opex_form') if request else '/calculations/processing-opex', "label": "Processing Opex Planner", "match_prefix": "/calculations/processing-opex"}, {"href": request.url_for('calculations.capex_form') if request else '/calculations/capex', "label": "Initial Capex Planner", "match_prefix": "/calculations/capex"} ] }, { "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"} ] } ] }, { "label": "Account", "links": account_links } ] %}