{% extends "user/base.html" %}

{% load passbook_utils %}
{% load i18n %}

{% block page %}
<div class="pf-c-card">
    <div class="pf-c-card__header pf-c-title pf-m-md">
        {% trans "One-Time Passwords" %}
    </div>
    <div class="pf-c-card__body">
        <p>
            {% blocktrans with state=state|yesno:"Enabled,Disabled" %}
            Status: {{ state }}
            {% endblocktrans %}
            {% if state %}
            <i class="pf-icon pf-icon-ok"></i>
            {% else %}
            <i class="pf-icon pf-icon-error-circle-o"></i>
            {% endif %}
        </p>
        <p>
            {% if not state %}
            <a href="{% url 'passbook_stages_otp:otp-enable' %}" class="btn btn-success btn-sm">{% trans "Enable OTP" %}</a>
            {% else %}
            <a href="{% url 'passbook_stages_otp:otp-disable' %}" class="btn btn-danger btn-sm">{% trans "Disable OTP" %}</a>
            {% endif %}
        </p>
    </div>
</div>

<div class="pf-c-card">
    <div class="pf-c-card__header pf-c-title pf-m-md">
        {% trans "Your Backup tokens:" %}
    </div>
    <div class="pf-c-card__body">
        <pre>{% for token in static_tokens %}{{ token.token }}
        {% empty %}{% trans 'N/A' %}{% endfor %}</pre>
        </div>
    </div>
</div>
{% endblock %}
