{% load static %}
<nav class="navbar navbar-expand-lg navbar-dark" style="background-color: #3498db;">
    <a class="navbar-brand" href="{% url 'index' %}">
        <h4>CameraHub</h4>
    </a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
        aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">

            <li class="nav-item active dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
                    aria-haspopup="true" aria-expanded="false">
                    Public data
                </a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                    <a class="dropdown-item" href="{% url 'cameramodel-list' %}">Camera models</a>
                    <a class="dropdown-item" href="{% url 'lensmodel-list' %}">Lens models</a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="{% url 'battery-list' %}">Batteries</a>
                    <a class="dropdown-item" href="{% url 'developer-list' %}">Developers</a>
                    <a class="dropdown-item" href="{% url 'filmstock-list' %}">Film stocks</a>
                    <a class="dropdown-item" href="{% url 'filter-list' %}">Filters</a>
                    <a class="dropdown-item" href="{% url 'flashprotocol-list' %}">Flash protocols</a>
                    <a class="dropdown-item" href="{% url 'format-list' %}">Formats</a>
                    <a class="dropdown-item" href="{% url 'manufacturer-list' %}">Manufacturers</a>
                    <a class="dropdown-item" href="{% url 'mount-list' %}">Mounts</a>
                    <a class="dropdown-item" href="{% url 'negativesize-list' %}">Negative sizes</a>
                    <a class="dropdown-item" href="{% url 'paperstock-list' %}">Paper stocks</a>
                    <a class="dropdown-item" href="{% url 'process-list' %}">Processes</a>
                    <a class="dropdown-item" href="{% url 'toner-list' %}">Toners</a>
                </div>
            </li>

            {% if user.is_authenticated %}
            <li class="nav-item active dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
                    aria-haspopup="true" aria-expanded="false">
                    Private data
                </a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                    <a class="dropdown-item" href="{% url 'camera-list' %}">Cameras</a>
                    <a class="dropdown-item" href="{% url 'lens-list' %}">Lenses</a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="{% url 'accessory-list' %}">Accessories</a>
                    <a class="dropdown-item" href="{% url 'archive-list' %}">Archives</a>
                    <a class="dropdown-item" href="{% url 'bulkfilm-list' %}">Bulk films</a>
                    <a class="dropdown-item" href="{% url 'enlarger-list' %}">Enlargers</a>
                    <a class="dropdown-item" href="{% url 'film-list' %}">Films</a>
                    <a class="dropdown-item" href="{% url 'flash-list' %}">Flashes</a>
                    <a class="dropdown-item" href="{% url 'mountadapter-list' %}">Mount adapters</a>
                    <a class="dropdown-item" href="{% url 'negative-list' %}">Negatives</a>
                    <a class="dropdown-item" href="{% url 'order-list' %}">Orders</a>
                    <a class="dropdown-item" href="{% url 'person-list' %}">People</a>
                    <a class="dropdown-item" href="{% url 'print-list' %}">Prints</a>
                    <a class="dropdown-item" href="{% url 'repair-list' %}">Repairs</a>
                    <a class="dropdown-item" href="{% url 'scan-list' %}">Scans</a>
                    <a class="dropdown-item" href="{% url 'series-list' %}">Series</a>
                    <a class="dropdown-item" href="{% url 'teleconverter-list' %}">Teleconverters</a>
                </div>
            </li>
            {% else %}
            <li class="nav-item active">
                <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Private data</a>
            </li>
            {% endif %}

            <li class="nav-item active dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
                    aria-haspopup="true" aria-expanded="false">
                    Help
                </a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">

                    <a class="dropdown-item" href="{% url 'about' %}">About</a>
                    <a class="dropdown-item" href="{% url 'concepts' %}">Concepts</a>
                    <a class="dropdown-item" href="{% url 'stats' %}">Stats</a>
                </div>
            </li>

            {% if user.is_authenticated %}
            <li class="nav-item active dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
                    aria-haspopup="true" aria-expanded="false">
                    {{ user.username }}
                </a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                    <a class="dropdown-item" href="{% url 'logout' %}">Logout</a>
                    <a class="dropdown-item" href="{% url 'password_change' %}">Change password</a>
                </div>
            </li>
            {% else %}
            <li class="nav-item active">
                <a class="nav-link" href="{% url 'login' %}">Login</a>
            </li>
            {% endif %}
        </ul>
        <form class="form-inline my-2 my-lg-0" action="{% url 'search' %}">
            <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" name="q" value="{{request.GET.q}}">
            <button class="btn btn-light my-2 my-sm-0" type="submit">Search</button>
        </form>
    </div>
</nav>