From d6c600628b59b337ea0abab3eee68cd6e66a65bb Mon Sep 17 00:00:00 2001 From: gpkvt Date: Sun, 4 Jun 2023 11:53:32 +0200 Subject: [PATCH] Extended template usage --- templates/base.html | 44 +++++++++++++++++++++++++++++ templates/index.html | 65 ++++++------------------------------------- templates/toggle.html | 15 ++++++++++ 3 files changed, 67 insertions(+), 57 deletions(-) create mode 100644 templates/base.html create mode 100644 templates/toggle.html diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..09d825f --- /dev/null +++ b/templates/base.html @@ -0,0 +1,44 @@ + +{%- if theme == "light" %} + +{%- else %} + +{%- endif %} + + + {{ title }} + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ {% block main %} + {% endblock %} +
+ + + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 36fe93b..602c45f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,37 +1,6 @@ - -{%- if theme == "light" %} - -{%- else %} - -{%- endif %} +{% extends 'base.html' %} - - {{ title }} - - - - - - - - - - - - - - - - - - - - - - -
- -
+{% block main %} {%- set id = namespace(value=0) %} {%- for question in content %} {%- set id.value = id.value + 1 %} @@ -45,33 +14,15 @@
{%- endfor %} - - - - \ No newline at end of file +{% endblock %} diff --git a/templates/toggle.html b/templates/toggle.html new file mode 100644 index 0000000..013546f --- /dev/null +++ b/templates/toggle.html @@ -0,0 +1,15 @@ +
 
+
+ {%- if theme == "light" %} + + {%- else %} + + {%- endif %} + +