From 0af69075c28f7eed4d0161759f9ae6b59e8a937e Mon Sep 17 00:00:00 2001 From: fenix Date: Tue, 13 Feb 2024 17:45:22 +0100 Subject: [PATCH] ++ Modo OScuro | Claro via Macros --- templates/base.html | 5 +++++ templates/macros.html | 18 ++++++++++++++++++ templates/results.html | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 templates/macros.html diff --git a/templates/base.html b/templates/base.html index a2e14fe..18fb6b9 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,5 +1,7 @@ {# templates/base.html #} +{% import "macros.html" as macros %} + @@ -15,5 +17,8 @@ {% block content %}

Welcome to {{ title }}!

{% endblock content %} + diff --git a/templates/macros.html b/templates/macros.html new file mode 100644 index 0000000..d5d5186 --- /dev/null +++ b/templates/macros.html @@ -0,0 +1,18 @@ +{# templates/macros.html #} + +{% macro light_or_dark_mode(element) %} + {% if request.args.get('mode') == "dark" %} + Cambiamos a Modo Claro + + {% else %} + Cambiamos a Modo Oscuro + {% endif %} +{% endmacro %} diff --git a/templates/results.html b/templates/results.html index b81fe85..4ef4773 100644 --- a/templates/results.html +++ b/templates/results.html @@ -6,7 +6,7 @@

{{ test_name }} {{ title }}: