first commit
This commit is contained in:
5
templates/mfa/recovery_codes/base.html
Executable file
5
templates/mfa/recovery_codes/base.html
Executable file
@@ -0,0 +1,5 @@
|
||||
{% extends "mfa/base_manage.html" %}
|
||||
{% load i18n %}
|
||||
{% block head_title %}
|
||||
{% trans "Recovery Codes" %}
|
||||
{% endblock head_title %}
|
||||
2
templates/mfa/recovery_codes/download.txt
Executable file
2
templates/mfa/recovery_codes/download.txt
Executable file
@@ -0,0 +1,2 @@
|
||||
{% for code in unused_codes %}{{ code }}
|
||||
{% endfor %}
|
||||
33
templates/mfa/recovery_codes/generate.html
Executable file
33
templates/mfa/recovery_codes/generate.html
Executable file
@@ -0,0 +1,33 @@
|
||||
{% extends "mfa/recovery_codes/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load allauth %}
|
||||
{% block content %}
|
||||
{% element h1 %}
|
||||
{% translate "Recovery Codes" %}
|
||||
{% endelement %}
|
||||
{% element p %}
|
||||
{% blocktranslate %}You are about to generate a new set of recovery codes for your account.{% endblocktranslate %}
|
||||
{% if unused_code_count %}
|
||||
{% blocktranslate %}This action will invalidate your existing codes.{% endblocktranslate %}
|
||||
{% endif %}
|
||||
{% blocktranslate %}Are you sure?{% endblocktranslate %}
|
||||
{% endelement %}
|
||||
{% url 'mfa_generate_recovery_codes' as action_url %}
|
||||
{% element form method="post" action=action_url no_visible_fields=True %}
|
||||
{% slot body %}
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
{% endslot %}
|
||||
{% slot actions %}
|
||||
{% setvar tags %}
|
||||
{% if unused_code_count %}
|
||||
danger
|
||||
{% else %}
|
||||
{% endif %}
|
||||
{% endsetvar %}
|
||||
{% element button type="submit" tags=tags %}
|
||||
{% trans "Generate" %}
|
||||
{% endelement %}
|
||||
{% endslot %}
|
||||
{% endelement %}
|
||||
{% endblock content %}
|
||||
30
templates/mfa/recovery_codes/index.html
Executable file
30
templates/mfa/recovery_codes/index.html
Executable file
@@ -0,0 +1,30 @@
|
||||
{% extends "mfa/recovery_codes/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load allauth %}
|
||||
{% block content %}
|
||||
{% element h1 %}
|
||||
{% translate "Recovery Codes" %}
|
||||
{% endelement %}
|
||||
{% element p %}
|
||||
{% blocktranslate count unused_count=unused_codes|length %}There is {{ unused_count }} out of {{ total_count }} recovery codes available.{% plural %}There are {{ unused_count }} out of {{ total_count }} recovery codes available.{% endblocktranslate %}
|
||||
{% endelement %}
|
||||
{% element field id="recovery_codes" type="textarea" disabled=True rows=unused_codes|length readonly=True %}
|
||||
{% slot label %}
|
||||
{% translate "Unused codes" %}
|
||||
{% endslot %}
|
||||
{% comment %} djlint:off {% endcomment %}
|
||||
{% slot value %}{% for code in unused_codes %}{% if forloop.counter0 %}
|
||||
{% endif %}{{ code }}{% endfor %}{% endslot %}
|
||||
{% comment %} djlint:on {% endcomment %}
|
||||
{% endelement %}
|
||||
{% if unused_codes %}
|
||||
{% url 'mfa_download_recovery_codes' as download_url %}
|
||||
{% element button href=download_url %}
|
||||
{% translate "Download codes" %}
|
||||
{% endelement %}
|
||||
{% endif %}
|
||||
{% url 'mfa_generate_recovery_codes' as generate_url %}
|
||||
{% element button href=generate_url %}
|
||||
{% translate "Generate new codes" %}
|
||||
{% endelement %}
|
||||
{% endblock content %}
|
||||
Reference in New Issue
Block a user