{% load static i18n django_bootstrap5 ndh %}
<!doctype html>
<html lang="{{ LANGUAGE_CODE }}">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{% block pagetitle %}NDH pagetitle block {% endblock %}</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
    <link rel="stylesheet" href="{% static "css/ndh.css" %}" />
    {% block style %}{% endblock %}
  </head>
  <body>

    {% block header_navbar %}
    <header>
      <nav class="navbar navbar-expand-lg navbar-dark bg-dark sticky-top">
        <div class="container">
          <a class="navbar-brand" href="/" >{% block sitetitle %}NDH sitetitle block {% endblock%}</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">
              {% block navbarleft %}<li class="nav-item active"><a class="nav-link" href="#">NDH navbarleft block</a></li>{% endblock %}
            </ul>
            <ul class="navbar-nav">
              {% if request.user.is_authenticated %}
                <li class="nav-item"><a class="nav-link" href="{% url 'logout' %}">Log out</a></li>
                {% if request.user.is_superuser %}
                  <li class="nav-item"><a class="nav-link" href="{% url 'admin:index' %}">Admin</a></li>
                  {% if object_list %}
                  <li class="nav-item"><a class="nav-link" href="{{ object_list|admin_url }}">List</a></li>
                  {% endif %}
                  {% if object %}
                  <li class="nav-item"><a class="nav-link" href="{{ object|admin_url }}">Item</a></li>
                  {% endif %}
                {% endif %}
              {% else %}
                <li class="nav-item"><a class="nav-link" href="{% url 'login' %}?next={{ request.path }}">Log in</a></li>
              {% endif %}
            </ul>
          </div>
        </div>
      </nav>
    </header>
    {% endblock %}

    {% block main_content %}
    <div class="container mt-4" role="main">
      {% bootstrap_messages %}
      <main>
        {% block content %}
        <h1>NDH content block</h1>
        {% endblock %}
      </main>
    </div>
    <hr>
    {% endblock %}
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
    {% block scripts %}{% endblock %}
  </body>
</html>
