{% 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-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">{% translate "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 'moonmining:index' %}">{% translate "Moon Mining" %}</a>
        </div>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                {% if perms.moonmining.extractions_access %}
                    <li class="{% navactive request 'moonmining:extractions' %}">
                        <a href="{% url 'moonmining:extractions' %}">Extractions</a>
                    </li>
                {% endif %}
                {% if "/moonmining/extraction/" in request.path %}
                    <li class="{% renavactive request '/moonmining/extraction/' %}">
                        <a href="#">Extraction Details</a>
                    </li>
                {% endif %}
                <li class="{% navactive request 'moonmining:moons' %}">
                    <a href="{% url 'moonmining:moons' %}">Moons</a>
                </li>
                {% if "/moonmining/moon/" in request.path %}
                    <li class="{% renavactive request '/moonmining/moon/' %}">
                        <a href="#">Moon Details</a>
                    </li>
                {% endif %}
                 {% if perms.moonmining.reports_access %}
                    <li class="{% navactive request 'moonmining:reports' %}">
                        <a href="{% url 'moonmining:reports' %}">Reports</a>
                    </li>
                {% endif %}
            </ul>

            {% if perms.moonmining.add_refinery_owner %}
                <a class="btn btn-default navbar-btn" style="float: right" href="{% url 'moonmining:add_owner' %}">
                    Add Corporation
                </a>
            {% endif %}
        </div>

    </div>
</nav>
