{# Set defaults for variables #}


{# Front-end app naming #}

{% set show_queues = True if current_user.is_authenticated and (current_user.has_role('admin') or FLEXMEASURES_MODE == "demo") else False %}


{# Front-end menu, as columns with href, id, caption, and (fa fa-)icon #}

{% set navigation_bar = [
    ('dashboard', 'dashboard', 'Dashboard', 'dashboard'),
    ('assets', 'assets', 'Assets', 'list-ul'),
] if current_user.is_authenticated else [] %}
{% do navigation_bar.append(('users', 'users', 'Users', 'users')) if current_user.has_role('admin') %}
{% do navigation_bar.extend([
    ('portfolio', 'portfolio', 'Portfolio overview', 'briefcase'),
    ('analytics', 'analytics', 'Analytics', 'bar-chart'),
    ('upload', 'upload', 'Upload data', 'cloud-upload'),
]) if current_user.is_authenticated %}
{% do navigation_bar.extend([
    ('control', 'control', 'Flexibility actions', 'wrench'),
]) if FLEXMEASURES_SHOW_CONTROL_UI and current_user.is_authenticated %}
{% do navigation_bar.append(('tasks', 'tasks', 'Tasks', 'tasks')) if show_queues %}
{% do navigation_bar.append(('account', 'account', '', 'user')) if current_user.is_authenticated %}
{% do navigation_bar.append(('ui/static/documentation/html/index.html', 'docs', '', 'question')) if documentation_exists and current_user.is_authenticated %}

{% set active_page = active_page|default('dashboard') -%}


{# Front-end app contents, always include this #}

{% block base %} All your base are belong to us. {% endblock base %}