{# 36px sub-navigation strip for all Deal Flow pages #}
{% set currentRoute = app.request.attributes.get('_route') %}
<nav class="dealflow-subnav">
    <a class="dealflow-subnav__link {{ currentRoute == 'mautic_dealflow_pipeline' ? 'is-active' : '' }}"
       href="{{ path('mautic_dealflow_pipeline') }}" data-toggle="ajax">Pipeline</a>
    <a class="dealflow-subnav__link {{ currentRoute in ['mautic_dealflow_index', 'mautic_dealflow_view'] ? 'is-active' : '' }}"
       href="{{ path('mautic_dealflow_index') }}" data-toggle="ajax">Deals</a>
    <a class="dealflow-subnav__link {{ currentRoute == 'mautic_dealflow_task_queue' ? 'is-active' : '' }}"
       href="{{ path('mautic_dealflow_task_queue') }}" data-toggle="ajax">Tasks</a>
    {% if securityIsGranted('dealflow:reports:viewown') or securityIsGranted('dealflow:reports:viewother') %}
        <a class="dealflow-subnav__link {{ currentRoute == 'mautic_dealflow_reports' ? 'is-active' : '' }}"
           href="{{ path('mautic_dealflow_reports') }}" data-toggle="ajax">Reports</a>
    {% endif %}
    {% if securityIsGranted('dealflow:settings:viewown') or securityIsGranted('dealflow:settings:viewother') %}
        <div class="dealflow-subnav__dropdown">
            <button class="dealflow-subnav__link dealflow-subnav__gear" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="ri-settings-3-line"></i>
            </button>
            <ul class="dropdown-menu dropdown-menu-right">
                <li><a href="{{ path('mautic_dealflow_pipeline_settings_index') }}" data-toggle="ajax">Pipelines</a></li>
                <li><a href="{{ path('mautic_dealflow_stage_index') }}" data-toggle="ajax">Stages</a></li>
                <li><a href="{{ path('mautic_dealflow_field_index') }}" data-toggle="ajax">Custom Fields</a></li>
                <li><a href="{{ path('mautic_dealflow_inbound_webhook_index') }}" data-toggle="ajax">Webhooks</a></li>
                <li><a href="{{ path('mautic_dealflow_api_docs') }}" data-toggle="ajax">API Docs</a></li>
            </ul>
        </div>
    {% endif %}
</nav>
