{% load static i18n bootstrap4 ndh %}
<!doctype html>
<html lang="{{ LANGUAGE_CODE }}">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>{% block pagetitle %}NDH pagetitle block {% endblock %}</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    <link rel="stylesheet" href="{% static "css/ndh.css" %}" />
    {% block style %}{% endblock %}
  </head>
  <body>

    <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>
    <div class="container mt-4" role="main">
      {% bootstrap_messages %}
      {% block content %}
      <h1>NDH content block</h1>
      {% endblock %}
    </div>
    <hr>
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
    {% block scripts %}{% endblock %}
  </body>
</html>

