{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}Django-Dolt Demo{% endblock %}</title>
    <link rel="stylesheet" href="{% static 'demo_app/style.css' %}">
</head>
<body>
<div class="page">
    <header class="site-header">
        <div class="container">
            <a href="{% url 'index' %}" class="site-logo">
                <span class="mark">d.</span>
                django-dolt demo
            </a>
            <nav class="site-nav">
                <a href="{% url 'index' %}" {% block nav_home %}{% endblock %}>Home</a>
                <a href="{% url 'inventory' %}" {% block nav_inventory %}{% endblock %}>Inventory</a>
                <a href="{% url 'orders' %}" {% block nav_orders %}{% endblock %}>Orders</a>
                <a href="/admin/">Admin</a>
            </nav>
            <div class="site-auth">
                {% if user.is_authenticated %}
                <span class="auth-user">{{ user.username }}</span>
                <form method="post" action="{% url 'admin:logout' %}">
                    {% csrf_token %}
                    <button type="submit" class="btn btn-sm">Log out</button>
                </form>
                {% else %}
                <a href="/admin/login/?next={{ request.path }}" class="btn btn-sm">Log in</a>
                {% endif %}
            </div>
        </div>
    </header>

    <div class="page-content">
        <div class="container">
            {% if messages %}
            <div class="messages">
                {% for message in messages %}
                <div class="msg {{ message.tags }}">{{ message }}</div>
                {% endfor %}
            </div>
            {% endif %}

            {% block content %}{% endblock %}
        </div>
    </div>
</div>
</body>
</html>
