{% load staticfiles %}
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top" id="mainNav">
    <a class="navbar-brand" href="/">
        {% block titulosistema %} Prefeitura Municipal de Palmas{% endblock titulosistema %}
      </a>
    <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
            data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
            aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarResponsive">
    {#    inicia o menu superior#}
        <ul class="navbar-nav navbar-sidenav">
            {% for app in apps %}
                <li class="nav-item dropdown" data-toggle="tooltip" data-placement="right" title="{{ app.name_app }}">
                    <a class="nav-link nav-link-collapse collapsed" data-toggle="collapse" href="#collapse{{ forloop.counter }}">
                        <i class="fa fa-map"></i>
                        <span class="nav-link-text">{{ app.name_app }}</span>
                    </a>
                    <ul class="sidenav-second-level collapse" id="collapse{{ forloop.counter }}">
                        {% for app_model in app.models_app %}
                            <li>
                                <a href="{% url app_model.url_list_model %}">{{ app_model.name_model }}</a>
                            </li>
                        {% endfor %}
                    </ul>
                </li>
            {% endfor %}
        </ul>
{#    termina o menu lateral#}

{#    inicia o menu superior#}
        <ul class="navbar-nav sidenav-toggler">
            <li class="nav-item" id="sidenavTogglerLi">
                <a class="nav-link text-center" id="sidenavToggler">
                    <i class="fa fa-fw fa-angle-left text-white"></i>
                </a>
            </li>
        </ul>
        <ul class="nav navbar-nav navbar-right">
            <li><a class="nav-item nav-link" href="#"></a></li>
        </ul>
        <ul class="navbar-nav ml-auto">
{#            <li class="nav-item dropdown">#}
{#                <a class="nav-link dropdown-toggle mr-lg-2" href="#" id="messagesDropdown" data-toggle="dropdown"#}
{#                   aria-haspopup="true" aria-expanded="false">#}
{#                   <i class="fas fa-envelope"></i>#}
{#                    <span class="d-lg-none">Mensagens#}
{#                <span class="badge badge-pill badge-primary">12 Novas</span>#}
{#              </span>#}
{#                    <span class="new-indicator text-primary d-none d-lg-block">#}
{#                <i class="fa fa-fw fa-circle"></i>#}
{#                <span class="number">12</span>#}
{#              </span>#}
{#                </a>#}
{#                <div class="dropdown-menu" aria-labelledby="messagesDropdown">#}
{#                    <h6 class="dropdown-header">Novas mensagens:</h6>#}
{#                    <div class="dropdown-divider"></div>#}
{#                    <a class="dropdown-item" href="#">#}
{#                        <strong>David Miller</strong>#}
{#                        <span class="small float-right text-muted">11:21 AM</span>#}
{#                        <div class="dropdown-message small">Hey there! This new version of SB Admin is pretty awesome!#}
{#                            These messages clip off when they reach the end of the box so they don't overflow over to#}
{#                            the sides!#}
{#                        </div>#}
{#                    </a>#}
{#                    <div class="dropdown-divider"></div>#}
{#                    <a class="dropdown-item" href="#">#}
{#                        <strong>Jane Smith</strong>#}
{#                        <span class="small float-right text-muted">11:21 AM</span>#}
{#                        <div class="dropdown-message small">I was wondering if you could meet for an appointment at 3:00#}
{#                            instead of 4:00. Thanks!#}
{#                        </div>#}
{#                    </a>#}
{#                    <div class="dropdown-divider"></div>#}
{#                    <a class="dropdown-item" href="#">#}
{#                        <strong>John Doe</strong>#}
{#                        <span class="small float-right text-muted">11:21 AM</span>#}
{#                        <div class="dropdown-message small">I've sent the final files over to you for review. When#}
{#                            you're able to sign off of them let me know and we can discuss distribution.#}
{#                        </div>#}
{#                    </a>#}
{#                    <div class="dropdown-divider"></div>#}
{#                    <a class="dropdown-item small" href="#">#}
{#                        View all messages#}
{#                    </a>#}
{#                </div>#}
{#            </li>#}
{#            <li class="nav-item dropdown">#}
{#                <a class="nav-link dropdown-toggle mr-lg-2" href="#" id="alertsDropdown" data-toggle="dropdown"#}
{#                   aria-haspopup="true" aria-expanded="false">#}
{#                    <i class="fa fa-fw fa-bell"></i>#}
{#                    <span class="d-lg-none">Alerts#}
{#                <span class="badge badge-pill badge-danger">6 New</span>#}
{#              </span>#}
{#                    <span class="new-indicator text-danger d-none d-lg-block">#}
{#                <i class="fa fa-fw fa-circle"></i>#}
{#                <span class="number">6</span>#}
{#              </span>#}
{#                </a>#}
{#                <div class="dropdown-menu" aria-labelledby="alertsDropdown">#}
{#                    <h6 class="dropdown-header">New Alerts:</h6>#}
{#                    <div class="dropdown-divider"></div>#}
{#                    <a class="dropdown-item" href="#">#}
{#                <span class="text-success">#}
{#                  <strong>#}
{#                    <i class="fa fa-long-arrow-up"></i>#}
{#                    Status Update</strong>#}
{#                </span>#}
{#                        <span class="small float-right text-muted">11:21 AM</span>#}
{#                        <div class="dropdown-message small">This is an automated server response message. All systems#}
{#                            are online.#}
{#                        </div>#}
{#                    </a>#}
{#                    <div class="dropdown-divider"></div>#}
{#                    <a class="dropdown-item" href="#">#}
{#                <span class="text-danger">#}
{#                  <strong>#}
{#                    <i class="fa fa-long-arrow-down"></i>#}
{#                    Status Update</strong>#}
{#                </span>#}
{#                        <span class="small float-right text-muted">11:21 AM</span>#}
{#                        <div class="dropdown-message small">This is an automated server response message. All systems#}
{#                            are online.#}
{#                        </div>#}
{#                    </a>#}
{#                    <div class="dropdown-divider"></div>#}
{#                    <a class="dropdown-item" href="#">#}
{#                <span class="text-success">#}
{#                  <strong>#}
{#                    <i class="fa fa-long-arrow-up"></i>#}
{#                    Status Update</strong>#}
{#                </span>#}
{#                        <span class="small float-right text-muted">11:21 AM</span>#}
{#                        <div class="dropdown-message small">This is an automated server response message. All systems#}
{#                            are online.#}
{#                        </div>#}
{#                    </a>#}
{#                    <div class="dropdown-divider"></div>#}
{#                    <a class="dropdown-item small" href="#">#}
{#                        View all alerts#}
{#                    </a>#}
{#                </div>#}
{#            </li>#}
{#            <li class="nav-item">#}
{#                <form class="form-inline my-2 my-lg-0 mr-lg-2">#}
{#                    <div class="input-group">#}
{#                        <input type="text" class="form-control" placeholder="Buscar...">#}
{#                        <span class="input-group-btn">#}
{#                  <button class="btn btn-success" type="button">#}
{#                    <i class="fa fa-search"></i>#}
{#                  </button>#}
{#                </span>#}
{#                    </div>#}
{#                </form>#}
{#            </li>#}




            {% if user.is_authenticated %}
                <li class="nav-item">
                    <div  class="navbar-link mr-4">
                        {% if user.first_name %}
                            Olá {{ user.first_name }} {{ user.last_name }}
                        {% elif user.username  %}
                             Olá {{ user.username }}
                        {% endif %}
                    </div>
                </li>

                <li class="nav-item nav-space">
                    <a class="navbar-link" href="{% url 'core:password_change' %}"> Alterar Senha</a>
                </li>

                <li class="nav-item nav-space">
                    <a href="#" class="navbar-link" data-toggle="modal" data-target="#exampleModal">
                        <i class="fas fa-sign-out-alt"></i> Sair</a>
                </li>
            {% else %}
                <li class="nav-item"><a class="nav-link" href="{% url 'core:login' %}">Log in</a></li>
            {% endif %}
        </ul>

{#    termina o menu superior#}
    </div>
</nav>
