|
1 | 1 | {% extends "wagtailadmin/admin_base.html" %} |
2 | | -{% load static i18n %} |
| 2 | +{% load i18n wagtailadmin_tags %} |
3 | 3 | {% block titletag %}{% trans "Sign in" %}{% endblock %} |
4 | 4 | {% block bodyclass %}login{% endblock %} |
5 | 5 |
|
6 | | -{% block extra_css %} |
7 | | - {{ block.super }} |
8 | | - |
9 | | - <link rel="stylesheet" href="{% static 'wagtailadmin/css/layouts/login.css' %}" type="text/css" /> |
10 | | -{% endblock %} |
11 | | - |
12 | 6 | {% block furniture %} |
13 | | - <div class="content-wrapper"> |
14 | | - {% if messages or form.errors %} |
15 | | - <div class="messages"> |
| 7 | + <main class="content-wrapper" id="main"> |
| 8 | + <h1>{% block branding_login %}{% trans "Enter your two-factor authentication code" %}{% endblock %}</h1> |
| 9 | + |
| 10 | + <div class="messages" role="status"> |
| 11 | + {# Always show messages div so it can be appended to by JS #} |
| 12 | + {% if messages or form.errors %} |
16 | 13 | <ul> |
17 | 14 | {% if form.errors %} |
18 | 15 | <li class="error">{% blocktrans %}Invalid code{% endblocktrans %}</li> |
|
21 | 18 | <li class="{{ message.tags }}">{{ message }}</li> |
22 | 19 | {% endfor %} |
23 | 20 | </ul> |
24 | | - </div> |
25 | | - {% endif %} |
| 21 | + {% endif %} |
| 22 | + </div> |
26 | 23 |
|
27 | 24 | {% block above_login %}{% endblock %} |
28 | 25 |
|
29 | 26 | <form action="{% url 'wagtail_2fa_auth' %}" method="post" autocomplete="off" novalidate> |
30 | 27 | {% block login_form %} |
31 | | - {% csrf_token %} |
| 28 | + {% csrf_token %} |
32 | 29 |
|
33 | | - {% url 'wagtailadmin_home' as home_url %} |
34 | | - <input type="hidden" name="next" value="{{ next|default:home_url }}" /> |
| 30 | + {% url 'wagtailadmin_home' as home_url %} |
| 31 | + <input type="hidden" name="next" value="{{ next|default:home_url }}" /> |
35 | 32 |
|
36 | | - <h1>{% block branding_login %}{% trans "Enter your two-factor authentication code" %}{% endblock %}</h1> |
37 | | - |
38 | | - <ul class="fields"> |
39 | 33 | {% block fields %} |
40 | | - <li class="full"> |
41 | | - <div class="field iconfield"> |
42 | | - {{ form.otp_token.label_tag }} |
43 | | - <div class="input icon-locked"> |
44 | | - {{ form.otp_token }} |
45 | | - </div> |
46 | | - </div> |
47 | | - </li> |
| 34 | + {% field field=form.otp_token %}{% endfield %} |
48 | 35 |
|
49 | | - {% block extra_fields %} |
50 | | - {% for field_name, field in form.extra_fields %}gs |
51 | | - <li class="full"> |
52 | | - {{ field.label_tag }} |
53 | | - <div class="field iconfield"> |
54 | | - {{ field }} |
55 | | - </div> |
56 | | - </li> |
57 | | - {% endfor %} |
58 | | - {% endblock extra_fields %} |
| 36 | + {% block extra_fields %} |
| 37 | + {% for field_name, field in form.extra_fields %} |
| 38 | + {% field field=field %}{% endfield %} |
| 39 | + {% endfor %} |
| 40 | + {% endblock extra_fields %} |
59 | 41 |
|
60 | 42 | {% endblock %} |
61 | | - <li class="submit"> |
62 | | - {% block submit_buttons %} |
63 | | - <button type="submit" class="button button-longrunning" tabindex="3" data-clicked-text="{% trans 'Signing in…' %}"><span class="icon icon-spinner"></span><em>{% trans 'Sign in' %}</em></button> |
| 43 | + {% endblock %} |
| 44 | + <footer class="form-actions"> |
| 45 | + {% block submit_buttons %} |
| 46 | + <button type="submit" class="button button-longrunning" tabindex="3" data-clicked-text="{% trans 'Signing in…' %}">{% icon name="spinner" %}<em>{% trans 'Sign in' %}</em></button> |
64 | 47 | <a href="{% url "wagtailadmin_logout" %}" class="button button-secondary" tabindex="4">{% trans 'Sign out' %}</a> |
65 | | - {% endblock %} |
66 | | - </li> |
67 | | - </ul> |
68 | | - {% endblock %} |
| 48 | + {% endblock %} |
| 49 | + </footer> |
69 | 50 | </form> |
70 | 51 |
|
71 | 52 | {% block below_login %}{% endblock %} |
72 | 53 |
|
73 | | - </div> |
| 54 | + {% block branding_logo %} |
| 55 | + <div class="login-logo"> |
| 56 | + <img class="login-logo-img" alt="" src="{% versioned_static 'wagtailadmin/images/wagtail-logo.svg' %}" /> |
| 57 | + </div> |
| 58 | + {% endblock %} |
| 59 | + </main> |
74 | 60 | {% endblock %} |
0 commit comments