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

{% block main_content %}
<div class="new-narrow-panel">
  <h2 class="hd">{% trans "Backup Tokens" %}</h2>
  <div class="con">
  <p>{% blocktrans %}Backup tokens can be used when your primary and backup
      phone numbers aren't available. The backup tokens below can be used
      for login verification. If you've used up all your backup tokens, you
      can generate a new set of backup tokens. Only the backup tokens shown
      below will be valid.{% endblocktrans %}</p>

    {% if device.token_set.count %}
    <ul class="two-factor-auth-backup-token-list">
      {% for token in device.token_set.all %}
        <li>{{ token.token }}</li>
      {% endfor %}
    </ul>
    <p>{% blocktrans %}Print these tokens and keep them somewhere safe.{% endblocktrans %}</p>
  {% else %}
    <p>{% trans "You don't have any backup codes yet." %}</p>
  {% endif %}

  <form method="post">{% csrf_token %}{{ form }}
      <a href="{{ SITE_ROOT }}" class="sf-btn-link">{% trans "Back" %}</a>
      <button type="submit" style="margin-top:5px;">{% trans "Generate Tokens" %}</button>
  </form>
    </div>
</div>
{% endblock %}
