<!-- includes/nav.html -->
<!-- https://getbootstrap.com/docs/4.0/examples/starter-template/ -->
<!-- https://github.com/JTruax/bootstrap-starter-template/blob/master/template/start.html -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
  <a class="navbar-brand" href="{% url 'core:index' %}">Navbar</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarsExampleDefault">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item active">
        <a class="nav-link" href="{% url 'core:index' %}">Home <span class="sr-only">(current)</span></a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="{% url 'crm:person_list' %}">CRM</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="{% url 'expense:expense_list' %}">Despesas (modal + htmx)</a>
      </li>
    </ul>
    <ul class="navbar-nav">
      <li class="nav-item">
        {% if request.user.is_authenticated %}
          <a class="nav-link">Olá {{ request.user.get_full_name }}</a>
        {% endif %}
      </li>
      <li class="nav-item">
        {% if request.user.is_authenticated %}
          <a class="nav-link" href="{% url 'logout' %}">Logout</a>
        {% else %}
          <a class="nav-link" href="{% url 'login' %}">Login</a>
        {% endif %}
      </li>
    </ul>
  </div>
</nav>