{% load static %}
<header>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <nav class="navbar navbar-light" style="background-color: #113A60;">
    <a class="navbar-brand" href="{% url 'index' %}">
      <img src="{% static 'main/img/logo_real.png' %}" width="107" height="22" class="d-inline-block align-top" style="margin-left: 15px" alt="" loading="lazy">
      <t style="color:#FFFFFF">Access Controller</t>
    </a>
    {% if request.user.is_authenticated %}
      <div class="btn-group" role="group" aria-label="Basic example" style="margin-right: 9px">
        <a {% if profile_lit %}
            class="btn btn-primary"
          {% else %}
            class="btn btn-secondary"
          {% endif %}
        href="{% url 'profile' %}">Профиль</a>
        {% if perms.main.has_control_access %}
          <a {% if control_lit %}
              class="btn btn-primary"
            {% else %}
              class="btn btn-secondary"
            {% endif %}
          href="{% url 'control' %}">Управление</a>
          <a {% if stats_lit %}
              class="btn btn-primary"
            {% else %}
              class="btn btn-secondary"
            {% endif %}
          href="{% url 'statistic' %}">Статистика</a>
        {% else %}
          <a {% if work_lit %}
              class="btn btn-primary"
            {% else %}
              class="btn btn-secondary"
            {% endif %}
          href="{% url 'work' request.user.id %}">Запрос прав</a>
        {% endif %}
        <a class="btn btn-secondary" href="{% url 'logout' %}">Выйти</a>
      </div>
    {% else %}
      <div class="btn-group" role="group" aria-label="Basic example" style="margin-right: 9px">
        <a {% if login_lit %}
            class="btn btn-primary"
          {% else %}
            class="btn btn-secondary"
          {% endif %}
        href="/accounts/login">Войти</a>
        <a {% if registration_lit %}
            class="btn btn-primary"
          {% else %}
            class="btn btn-secondary"
          {% endif %}
        href="/accounts/register">Зарегистрироваться</a>
      </div>
    {% endif %}
  </nav>
</header>
