{% extends "base.html" %}
{% block content %}
<div class="ui compact inverted segment">
  <form class= "ui form" method="post" action="{% url 'core:login' %}">
    {% csrf_token %}
    <div class="required field">
      <label id="username" for="id_username"><i class="user icon"></i>Username:</label>
      {{ form.username }}
    </div>
    <div class="required field">
      <label for="id_username"><i class="key icon"></i>Password:</label>
      {{ form.password }}
    </div>
    {% if form.errors %}
      <div class="ui inverted red message">Username and password didn't match.</div>
    {% endif %}
    {% if next %}
      {% if user.is_authenticated %}
        <div class="ui inverted orange message">Your account doesn't have access to this page. To proceed, please login with an account that has access.</div>
      {% endif %}
    {% endif %}
    <button class="ui primary button" type="submit"><i class="door open icon"></i>Log in</button>
    <input type="hidden" name="next" value="{{ next }}">
  </form>
</div>
{% endblock %}
