<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
  <a class="navbar-brand" href="{{ url_for('public.home') }}" style="white-space:normal;">
    <img src="{{url_for('static', filename='logo.svg') }}" alt="Logo" width="40px">
    Evidence dárců ČČK Frýdek-Místek
  </a>

  <ul class="navbar-nav mr-auto">
    {% if current_user and current_user.is_authenticated %}
    <li class="nav-item">
      <a class="nav-link" href="{{ url_for('donor.overview') }}">Přehled dárců</a>
    </li>
    <li class="nav-item dropdown">
      <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
        Import dat
      </a>
      <div class="dropdown-menu">
          <a class="dropdown-item" href="{{ url_for('batch.import_data') }}">Import darování</a>
          <a class="dropdown-item" href="{{ url_for('batch.import_contacts') }}">Import kontaktů</a>
      </div>
    </li>
    <li class="nav-item dropdown">
      <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
        Přehledy
      </a>
      <div class="dropdown-menu">
          <a class="dropdown-item" href="{{ url_for('donor.awarded') }}">Přehled oceněných dárců</a>
          <a class="dropdown-item" href="{{ url_for('donor.show_ignored') }}">Ignorovaní dárci</a>
          <a class="dropdown-item" href="{{ url_for('batch.batch_list') }}">Přehled importů darování</a>
          <a class="dropdown-item" href="{{ url_for('batch.contact_import_logs') }}">Přehled importů kontaktů</a>
      </div>
    </li>

    <li class="nav-item dropdown">
      <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
        Oceňování dárců
      </a>
      <div class="dropdown-menu">
        {% for medal in all_medals %}
          <a class="dropdown-item" href="{{ url_for('donor.award_prep', medal_slug=medal.slug)}}">{{ medal.title }}</a>
        {% endfor %}
      </div>
    </li>
    {% endif %}
  </ul>

  <ul class="navbar-nav ml-auto">
    {% if current_user and current_user.is_authenticated %}
      <li class="nav-item">
        <span class="navbar-text">
          Přihlášen jako {{ current_user.email }}
        </span>
        <a class="btn btn-info" role="button" href="{{ url_for('public.logout') }}">Odhlásit se</a>
      </li>
    {% elif form %}
      {% with form=form %}
      <form class="form-inline" id="loginForm" method="POST" action="/" role="login">
          {{ form.csrf_token }}
          <div>
            {{ form.email(placeholder="E-mail", class_="form-control mr-sm-2 my-auto") }} {{ form.password(placeholder="Heslo",
            class_="form-control mr-sm-2 my-auto") }}
            <button class="btn btn-success" type="submit">Přihlásit</button>
          </div>
      </form>
      {% endwith %}
    {% endif %}
  </ul>
</nav>
