diff --git a/src/adminui/templates/auth/login.html b/src/adminui/templates/auth/login.html index 6a61642..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,11 +74,7 @@ -
- - - {% if is_incorrect and message_content %}
{{ message_content }}
{% endif %} -
+ {{ password_input(name="password", error=message_content if is_incorrect else None) }}
@@ -83,3 +82,26 @@
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..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 %}