{% load static %}
{% load i18n %}
{% load navactive %}

<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-buybackprogram-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">{% trans "Toggle navigation" %}</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{% url 'buybackprogram:index' %}">{% trans "Buyback Programs" %}</a>
        </div>

        <div class="collapse navbar-collapse" id="bs-buybackprogram-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class="{% navactive request 'buybackprogram:my_stats' %}">
                    <a href="{% url 'buybackprogram:my_stats' %}">
                        My Statistics
                    </a>
                </li>
                {% if perms.buybackprogram.manage_programs %}
                    <li class="{% navactive request 'buybackprogram:program_stats' %}">
                        <a href="{% url 'buybackprogram:program_stats' %}">
                            My Program Statistics
                        </a>
                    </li>
                {% endif %}
                {% if perms.buybackprogram.manage_all_programs %}
                    <li class="{% navactive request 'buybackprogram:program_stats_all' %}">
                        <a href="{% url 'buybackprogram:program_stats_all' %}">
                            All Program Statistics
                        </a>
                    </li>
                {% endif %}
            </ul>
            <ul class="nav navbar-nav navbar-right">
                {% if perms.buybackprogram.manage_programs %}
                    <a class="btn btn-default navbar-btn" href="{% url 'buybackprogram:location_add' %}">
                        Add location
                    </a>
                    <a class="btn btn-default navbar-btn" href="{% url 'buybackprogram:program_add' %}">
                        Create Program
                    </a>
                {% endif %}
                {% if perms.buybackprogram.manage_programs %}
                    <a class="btn btn-default navbar-btn" href="{% url 'buybackprogram:setup' %}">
                        Setup Manager
                    </a>
                {% endif %}
            </ul>
        </div>
    </div>
</nav>
