{% extends "authentic2/base-page.html" %}
{% load i18n %}

{% block title %}
{% trans "Log in to link your certificate with an existing account" %}
{% endblock %}

{% block content %}
<p>* {% trans "Log in to link your certificate with an existing account" %}</p>
<div id="login-actions">
  <form id="login-form" method="post" action="{% url "post_account_linking" %}">
  {% csrf_token %}
  <ul class="errorlist">
    {% for error in form.non_field_errors %}
      <li>{{ error|escape }}</li>
    {% endfor %}
    {% for error in form.username.errors %}
      <li>{% trans "Username:" %} {{ error|escape }}</li>
    {% endfor %}
    {% for error in form.password.errors %}
      <li>{% trans "Password:" %} {{ error|escape }}</li>
    {% endfor %}
  </ul>
  <p>
    <label for="id_username">{% trans "Username:" %}</label>
    <input id="id_username" type="text" name="username" maxlength="30" />
  </p>
  <p>
    <label for="id_password">{% trans "Password:" %}</label>
    <input type="password" name="password" id="id_password" />
  </p>

  <p>
    <label for="id_do_creation">{% trans "Create me a new account" %}</label>
    <input type="checkbox" name="do_creation" id="id_do_creation" />
  </p>

  <button class="submit-button">{% trans 'Log in' %}</button>
  <input type="hidden" name="next" value="{{ next_url }}" />
</form>
</div>
<script type="text/javascript">
document.getElementById('id_username').focus();
</script>
{% endblock %}
