diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c6d9c1..9aa3db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- Password visibility toggle on login page (dashboard#46) + ## [1.3.2] - 2025-12-11 ### Fixed diff --git a/src/adminui/templates/auth/login.html b/src/adminui/templates/auth/login.html index 6a61642..4315def 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 %} @@ -56,6 +59,8 @@ --bs-link-hover-color-rgb: 227,130,14; text-decoration: none; } + + .password-toggle, .password-toggle:hover, .password-toggle:focus { border-color: var(--bs-border-color); } {% endblock %} @@ -71,11 +76,7 @@ -
- - - {% if is_incorrect and message_content %}
{{ message_content }}
{% endif %} -
+ {{ password_input(name="password", error=message_content if is_incorrect else None) }}
@@ -83,3 +84,27 @@
Return to the Hotspot
{% 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..8adf0c8 --- /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 %}