12
12
13
13
{% block content %}
14
14
< main class ="flex flex-col gap-10 ">
15
- {% if features.password_login %}
16
- < header class ="page-heading ">
17
- < div class ="icon ">
18
- {{ icon.user_profile_solid() }}
19
- </ div >
15
+ < header class ="page-heading ">
16
+ < div class ="icon ">
17
+ {{ icon.user_profile_solid() }}
18
+ </ div >
20
19
21
- {% if next and next.kind == "link_upstream" %}
22
- < div class ="header ">
23
- < h1 class ="title "> {{ _("mas.login.link.headline") }}</ h1 >
24
- {% set name = provider.human_name or (provider.issuer | simplify_url(keep_path=True)) or provider.id %}
25
- < p class ="text "> {{ _("mas.login.link.description", provider=name) }}</ p >
26
- </ div >
27
- {% else %}
28
- < div class ="header ">
29
- < h1 class ="title "> {{ _("mas.login.headline") }}</ h1 >
30
- < p class ="text "> {{ _("mas.login.description") }}</ p >
31
- </ div >
32
- {% endif %}
33
- </ header >
20
+ {% if next and next.kind == "link_upstream" %}
21
+ < div class ="header ">
22
+ < h1 class ="title "> {{ _("mas.login.link.headline") }}</ h1 >
23
+ {% set name = provider.human_name or (provider.issuer | simplify_url(keep_path=True)) or provider.id %}
24
+ < p class ="text "> {{ _("mas.login.link.description", provider=name) }}</ p >
25
+ </ div >
26
+ {% else %}
27
+ < div class ="header ">
28
+ < h1 class ="title "> {{ _("mas.login.headline") }}</ h1 >
29
+ < p class ="text "> {{ _("mas.login.description") }}</ p >
30
+ </ div >
31
+ {% endif %}
32
+ </ header >
34
33
35
- < form method ="POST " class ="cpd-form-root ">
34
+ < form method ="POST " class ="flex flex-col gap-10 ">
35
+ < div class ="cpd-form-root ">
36
36
{% if form.errors is not empty %}
37
37
{% for error in form.errors %}
38
38
< div class ="text-critical font-medium ">
@@ -47,47 +47,47 @@ <h1 class="title">{{ _("mas.login.headline") }}</h1>
47
47
< input {{ field.attributes(f) }} class ="cpd-text-control " type ="text " autocomplete ="username " autocorrect ="off " autocapitalize ="off " required />
48
48
{% endcall %}
49
49
50
- {% call(f) field.field(label=_("common.password"), name="password", form_state=form) %}
51
- < input {{ field.attributes(f) }} class ="cpd-text-control " type ="password " autocomplete ="password " required />
52
- {% endcall %}
50
+ {% if features.password_login %}
51
+ {% call(f) field.field(label=_("common.password"), name="password", form_state=form) %}
52
+ < input {{ field.attributes(f) }} class ="cpd-text-control " type ="password " autocomplete ="password " required />
53
+ {% endcall %}
53
54
54
- {% if features.account_recovery %}
55
- {{ button.link_text(text=_("mas.login.forgot_password"), href="/recover", class="self-center") }}
55
+ {% if features.account_recovery %}
56
+ {{ button.link_text(text=_("mas.login.forgot_password"), href="/recover", class="self-center") }}
57
+ {% endif %}
56
58
{% endif %}
59
+ </ div >
57
60
58
- {{ button.button(text=_("action.continue")) }}
59
- </ form >
61
+ < div class ="cpd-form-root ">
62
+ {% if features.password_login %}
63
+ {{ button.button(text=_("action.continue")) }}
64
+ {% endif %}
60
65
61
- {% if (not next or next.kind != "link_upstream") and features.password_registration %}
62
- < div class ="flex gap-1 justify-center items-center cpd-text-body-md-regular ">
63
- < p class ="cpd-text-secondary ">
64
- {{ _("mas.login.call_to_register") }}
65
- </ p >
66
+ {% if features.password_login and providers %}
67
+ {{ field.separator() }}
68
+ {% endif %}
66
69
70
+ {% if providers %}
67
71
{% set params = next["params"] | default({}) | to_params(prefix="?") %}
68
- {{ button.link_text(text=_("action.create_account"), href="/register" ~ params) }}
69
- </ div >
70
- {% endif %}
71
- {% endif %}
72
-
73
- {% if providers %}
74
- {% if features.password_login %}
75
- {{ field.separator() }}
76
- {% endif %}
72
+ {% for provider in providers %}
73
+ {% set name = provider.human_name or (provider.issuer | simplify_url(keep_path=True)) or provider.id %}
74
+ < a class ="cpd-button {%- if provider.brand_name %} has-icon {%- endif %} " data-kind ="secondary " data-size ="lg " href ="{{ ('/upstream/authorize/' ~ provider.id ~ params) | prefix_url }} ">
75
+ {{ logo(provider.brand_name) }}
76
+ {{ _("mas.login.continue_with_provider", provider=name) }}
77
+ </ a >
78
+ {% endfor %}
79
+ {% endif %}
80
+ </ div >
81
+ </ form >
77
82
78
- {% set params = next["params"] | default({}) | to_params(prefix="?") %}
79
- {% for provider in providers %}
80
- {% set name = provider.human_name or (provider.issuer | simplify_url(keep_path=True)) or provider.id %}
81
- < a class ="cpd-button {%- if provider.brand_name %} has-icon {%- endif %} " data-kind ="secondary " data-size ="lg " href ="{{ ('/upstream/authorize/' ~ provider.id ~ params) | prefix_url }} ">
82
- {{ logo(provider.brand_name) }}
83
- {{ _("mas.login.continue_with_provider", provider=name) }}
84
- </ a >
85
- {% endfor %}
86
- {% endif %}
83
+ {% if (not next or next.kind != "link_upstream") and features.password_registration %}
84
+ < div class ="flex gap-1 justify-center items-center cpd-text-body-md-regular ">
85
+ < p class ="cpd-text-secondary ">
86
+ {{ _("mas.login.call_to_register") }}
87
+ </ p >
87
88
88
- {% if not providers and not features.password_login %}
89
- < div class ="text-center ">
90
- {{ _("mas.login.no_login_methods") }}
89
+ {% set params = next["params"] | default({}) | to_params(prefix="?") %}
90
+ {{ button.link_text(text=_("action.create_account"), href="/register" ~ params) }}
91
91
</ div >
92
92
{% endif %}
93
93
@@ -101,5 +101,11 @@ <h1 class="title">{{ _("mas.login.headline") }}</h1>
101
101
params=dict(error="access_denied", state=next.grant.state)
102
102
) }}
103
103
{% endif %}
104
+
105
+ {% if not providers and not features.password_login %}
106
+ < div class ="text-center ">
107
+ {{ _("mas.login.no_login_methods") }}
108
+ </ div >
109
+ {% endif %}
104
110
</ main >
105
111
{% endblock content %}
0 commit comments