From 78696f2f1000dd8715b76a865ee95da564185d0c Mon Sep 17 00:00:00 2001 From: lumpy Date: Fri, 16 Jan 2026 16:14:04 +0100 Subject: [PATCH 1/4] add password visibility toggle --- src/adminui/templates/auth/login.html | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/adminui/templates/auth/login.html b/src/adminui/templates/auth/login.html index 6a61642..b16e7a5 100644 --- a/src/adminui/templates/auth/login.html +++ b/src/adminui/templates/auth/login.html @@ -4,6 +4,7 @@ {% block title %}Sign into Kiwix Admin{% endblock %} {% block head %} + {% endblock %} @@ -72,14 +81,21 @@ -
+
- {% if is_incorrect and message_content %}
{{ message_content }}
{% endif %}
@@ -90,18 +106,24 @@ {% endblock %} From 136c6309e66e74c90a55a16e5d8207276100c313 Mon Sep 17 00:00:00 2001 From: lumpy Date: Wed, 21 Jan 2026 14:34:22 +0100 Subject: [PATCH 3/4] fix layout and hover visibility --- src/adminui/templates/auth/login.html | 42 +++++++++++---------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/src/adminui/templates/auth/login.html b/src/adminui/templates/auth/login.html index e5be4cb..fa62c13 100644 --- a/src/adminui/templates/auth/login.html +++ b/src/adminui/templates/auth/login.html @@ -56,16 +56,6 @@ --bs-link-hover-color-rgb: 227,130,14; text-decoration: none; } - - #toggle-password { - border: none; - background: transparent; - } - - .items-center { - display: flex; - align-items: center; - } {% endblock %} @@ -81,22 +71,24 @@
-
+
- - - - {% if is_incorrect and message_content %}
{{ message_content }}
{% endif %} +
+ + + + {% if is_incorrect and message_content %}
{{ message_content }}
{% endif %} +
From 1fa98d362345c106d5fe4e95a1073ecc02f4a029 Mon Sep 17 00:00:00 2001 From: lumpy Date: Wed, 21 Jan 2026 15:20:50 +0100 Subject: [PATCH 4/4] Refactor: extract password toggle to macro and put SVGs in files --- src/adminui/templates/auth/login.html | 58 +++++++++-------------- src/adminui/templates/icons/eye-slash.svg | 5 ++ src/adminui/templates/icons/eye.svg | 4 ++ src/adminui/templates/macros.html | 20 ++++++++ 4 files changed, 51 insertions(+), 36 deletions(-) create mode 100644 src/adminui/templates/icons/eye-slash.svg create mode 100644 src/adminui/templates/icons/eye.svg create mode 100644 src/adminui/templates/macros.html diff --git a/src/adminui/templates/auth/login.html b/src/adminui/templates/auth/login.html index fa62c13..7fcecbd 100644 --- a/src/adminui/templates/auth/login.html +++ b/src/adminui/templates/auth/login.html @@ -1,5 +1,8 @@ {% extends "raw_base.html" %} +{# import the macro file to use the password function #} +{% from "macros.html" import password_input %} + {% block theme %}light{% endblock %} {% block title %}Sign into Kiwix Admin{% endblock %} @@ -71,51 +74,34 @@
-
- -
- - - - {% if is_incorrect and message_content %}
{{ message_content }}
{% endif %} -
-
+ {{ password_input(name="password", error=message_content if is_incorrect else None) }}
+{% endblock %} +{% block javascript %} {% endblock %} diff --git a/src/adminui/templates/icons/eye-slash.svg b/src/adminui/templates/icons/eye-slash.svg new file mode 100644 index 0000000..cf2e54d --- /dev/null +++ b/src/adminui/templates/icons/eye-slash.svg @@ -0,0 +1,5 @@ + diff --git a/src/adminui/templates/icons/eye.svg b/src/adminui/templates/icons/eye.svg new file mode 100644 index 0000000..3be9488 --- /dev/null +++ b/src/adminui/templates/icons/eye.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/adminui/templates/macros.html b/src/adminui/templates/macros.html new file mode 100644 index 0000000..73f06ea --- /dev/null +++ b/src/adminui/templates/macros.html @@ -0,0 +1,20 @@ +{% macro password_input(name, label="Password", placeholder="", error=None) %} +
+ +
+ + + + + {% if error %}
{{ error }}
{% endif %} +
+
+{% endmacro %}