<!DOCTYPE html>
<html lang="en">

<head>
    {% block title %}<title>CameraHub</title>{% endblock %}
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
        integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
    <!-- Add additional CSS in static file -->
    {% load static %}
    <link rel="stylesheet" href="{% static 'css/styles.css' %}">
</head>

<body>
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-2">
                {% block sidebar %}
                <h1>CameraHub</h1>
                {% if user.is_authenticated %}
                <p><a href="{% url 'logout' %}">Logout</a> {{ user.username }}</p>
                {% else %}
                <p><a href="{% url 'login' %}">Login</a></p>
                {% endif %}
                <hr />
                <!-- insert default navigation text for every page -->
                <ul class="sidebar-nav">
                    <li><a href="{% url 'index' %}">Home</a></li>
                    {% if user.is_authenticated %}
                    <li><a href="{% url 'accessory-list' %}">Accessories</a></li>
                    <li><a href="{% url 'archive-list' %}">Archives</a></li>
                    {% endif %}
                    <li><a href="{% url 'battery-list' %}">Batteries</a></li>
                    {% if user.is_authenticated %}
                    <li><a href="{% url 'bulkfilm-list' %}">Bulk films</a></li>
                    <li><a href="{% url 'camera-list' %}">Cameras</a></li>
                    {% endif %}
                    <li><a href="{% url 'cameramodel-list' %}">Camera models</a></li>
                    <li><a href="{% url 'developer-list' %}">Developers</a></li>
                    {% if user.is_authenticated %}
                    <li><a href="{% url 'enlarger-list' %}">Enlargers</a></li>
                    <li><a href="{% url 'film-list' %}">Films</a></li>
                    {% endif %}
                    <li><a href="{% url 'filmstock-list' %}">Film stocks</a></li>
                    {% if user.is_authenticated %}
                    <li><a href="{% url 'filter-list' %}">Filters</a></li>
                    <li><a href="{% url 'flash-list' %}">Flashes</a></li>
                    {% endif %}
                    <li><a href="{% url 'flashprotocol-list' %}">Flash protocols</a></li>
                    <li><a href="{% url 'format-list' %}">Formats</a></li>
                    {% if user.is_authenticated %}
                    <li><a href="{% url 'lens-list' %}">Lenses</a></li>
                    {% endif %}
                    <li><a href="{% url 'lensmodel-list' %}">Lens models</a></li>
                    <li><a href="{% url 'manufacturer-list' %}">Manufacturers</a></li>
                    <li><a href="{% url 'mount-list' %}">Mounts</a></li>
                    {% if user.is_authenticated %}
                    <li><a href="{% url 'mountadapter-list' %}">Mount adapters</a></li>
                    <li><a href="{% url 'negative-list' %}">Negatives</a></li>
                    {% endif %}
                    <li><a href="{% url 'negativesize-list' %}">Negative sizes</a></li>
                    {% if user.is_authenticated %}
                    <li><a href="{% url 'order-list' %}">Orders</a></li>
                    {% endif %}
                    <li><a href="{% url 'paperstock-list' %}">Paper stocks</a></li>
                    {% if user.is_authenticated %}
                    <li><a href="{% url 'person-list' %}">People</a></li></a></li>
                    <li><a href="{% url 'print-list' %}">Prints</a></li>
                    {% endif %}
                    <li><a href="{% url 'process-list' %}">Processes</a></li>
                    {% if user.is_authenticated %}
                    <li><a href="{% url 'repair-list' %}">Repairs</a></li>
                    <li><a href="{% url 'scan-list' %}">Scans</a></li>
                    <li><a href="{% url 'series-list' %}">Series</a></li>
                    <li><a href="{% url 'teleconverter-list' %}">Teleconverters</a></li>
                    {% endif %}
                    <li><a href="{% url 'toner-list' %}">Toners</a></li>
                </ul>
                {% endblock %}
            </div>
            <div class="col-sm-10 ">
                {% block heading %}{% endblock %}
                {% block subheading %}{% endblock %}
                {% block content %}
                <!-- default content text (typically empty) -->{% endblock %}
                {% block actions %}{% endblock %}
            </div>

            {% block pagination %}
            {% if is_paginated %}
            <div class="pagination">
                <span class="page-links">
                    {% if page_obj.has_previous %}
                    <a href="{{ request.path }}?page={{ page_obj.previous_page_number }}">previous</a>
                    {% endif %}
                    <span class="page-current">
                        Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
                    </span>
                    {% if page_obj.has_next %}
                    <a href="{{ request.path }}?page={{ page_obj.next_page_number }}">next</a>
                    {% endif %}
                </span>
            </div>
            {% endif %}
            {% endblock %}
        </div>
        {% block footer %}{% include "footer.html" %}{% endblock %}
    </div>
</body>

</html>