{% extends 'base.html' %}
{% load i18n %}

{% block title %}{% trans 'Login to yourivatar account' %}{% endblock title %}

{% block content %}

<h1>{% trans 'Login' %}</h1>

{% if form.errors %}
    {% for error in form.non_field_errors %}
<div class="alert alert-danger" role="alert">{{ error|escape }}</div>
    {% endfor %}
{% endif %}
{% if form.username.errors %}
<div class="alert alert-danger" role="alert">{{ form.username.errors }}</div>
{% endif %}
{% if form.password.errors %}
<div class="alert alert-danger" role="alert">{{ form.password.errors }}</div>
{% endif %}
<div style="max-width:700px">
<form action="{% url 'login' %}" method="post" name="login">
{% csrf_token %}
<div class="form-group">
<label for="id_username">{% trans 'Username' %}:</label>
<input type="text" name="username" autofocus required class="form-control" id="id_username">
</div>
<div class="form-group">
<label for="id_password">{% trans 'Password' %}:</label>
<input type="password" name="password" class="form-control" required id="id_password">
</div>
  <button type="submit" class="button">{% trans 'Login' %}</button>
  &nbsp;
  <a href="{% url 'openid-login' %}" class="button">{% trans 'Login with OpenID' %}</a>
  &nbsp;
  <a href="{% url 'new_account' %}" class="button">{% trans 'Create new user' %}</a>
  &nbsp;
  <a href="{% url 'password_reset' %}" class="button">{% trans 'Password reset' %}</a>
</form>
</div>
<div style="height:40px"></div>
{% endblock content %}
