first commit

This commit is contained in:
root
2024-09-20 04:29:09 +00:00
commit 5383007f49
459 changed files with 88755 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
{% extends "mfa/base_manage.html" %}
{% load i18n %}
{% block head_title %}
{% trans "Recovery Codes" %}
{% endblock head_title %}

View File

@@ -0,0 +1,2 @@
{% for code in unused_codes %}{{ code }}
{% endfor %}

View 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 %}

View 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 %}