From 0654dfb05df1ad36075b4441b4fd9fb7656a7b1c Mon Sep 17 00:00:00 2001 From: Sli Date: Thu, 17 Apr 2025 13:02:40 +0200 Subject: [PATCH] Fix overflow issue on login/register page --- core/static/user/login.scss | 38 ++++++++++++++++++------------ core/templates/core/login.jinja | 3 +-- core/templates/core/register.jinja | 2 +- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/core/static/user/login.scss b/core/static/user/login.scss index fb4a5768..5d506edd 100644 --- a/core/static/user/login.scss +++ b/core/static/user/login.scss @@ -24,13 +24,21 @@ body { background-color: white; margin: 0; - > .title { + .alert { + word-wrap: break-word; + white-space: normal; + text-align: center; + display: block; + width: fit-content; + } + + >.title { text-align: center; margin: 0; } - > div, - > form { + >div, + >form { box-sizing: border-box; display: flex; flex-direction: column; @@ -41,8 +49,8 @@ body { max-width: 500px; margin-top: 20px; - > p, - > div { + >p, + >div { display: flex; flex-direction: column; justify-content: center; @@ -50,7 +58,7 @@ body { width: 100%; margin: 0; - > label { + >label { width: 100%; @media (min-width: 500px) { @@ -59,9 +67,9 @@ body { } } - > input, - > p > input, - > div > input { + >input, + >p>input, + >div>input { box-sizing: border-box; width: 100%; max-width: 500px; @@ -71,35 +79,35 @@ body { } } - > .errorlist { + >.errorlist { color: red; text-align: center; margin: 10px 0 0 0; list-style-type: none; } - > .required > .helptext { + >.required>.helptext { text-align: center; font-style: italic; } - > .required:last-of-type { + >.required:last-of-type { box-sizing: border-box; max-width: 300px; flex-direction: row; flex-wrap: wrap; justify-content: space-between; - > label { + >label { width: 100%; } - > img { + >img { width: 70px; object-fit: contain; } - > input { + >input { width: 200px; } } diff --git a/core/templates/core/login.jinja b/core/templates/core/login.jinja index d696f4cd..65a1f8d5 100644 --- a/core/templates/core/login.jinja +++ b/core/templates/core/login.jinja @@ -29,14 +29,13 @@
{% if form.errors %}

{% trans %}Your username and password didn't match. Please try again.{% endtrans %}

-
{% endif %} {% csrf_token %}
- + {{ form.username }} {{ form.username.errors }}
diff --git a/core/templates/core/register.jinja b/core/templates/core/register.jinja index 6679435b..249de9bf 100644 --- a/core/templates/core/register.jinja +++ b/core/templates/core/register.jinja @@ -18,7 +18,7 @@ {% csrf_token %} {% render_honeypot_field %} - {{ form }} + {{ form.as_p() }}
{% endblock %}