From c5dceeb948a485dff4fabf3e1766ce2b0dc6f002 Mon Sep 17 00:00:00 2001 From: gord chung Date: Wed, 13 Dec 2023 10:41:39 -0500 Subject: [PATCH] define base jinja template --- app/templates/analytics.html | 31 ++++++++----------------------- app/templates/base.html | 28 ++++++++++++++++++++++++++++ app/templates/index.html | 29 ++++------------------------- app/templates/login.html | 29 ++++++++--------------------- app/templates/register.html | 21 ++++----------------- 5 files changed, 52 insertions(+), 86 deletions(-) create mode 100644 app/templates/base.html diff --git a/app/templates/analytics.html b/app/templates/analytics.html index 6a0457e..bd6d406 100644 --- a/app/templates/analytics.html +++ b/app/templates/analytics.html @@ -1,26 +1,16 @@ - - - - - - - - - +{% extends "base.html" %} +{% block title %}charts{% endblock %} +{% block head_css %} - - - +{% endblock %} +{% block head_scripts %} - +{% endblock %} - Charting - - - +{% block body %}

@@ -71,10 +61,6 @@

- - +{% endblock %} diff --git a/app/templates/base.html b/app/templates/base.html new file mode 100644 index 0000000..0c6f195 --- /dev/null +++ b/app/templates/base.html @@ -0,0 +1,28 @@ + + + + + + + + + + + {% block head_css %}{% endblock %} + + + {% block head_scripts %}{% endblock %} + + {% block title %}{% endblock %} + + + + {% block body %}{% endblock %} + + + diff --git a/app/templates/index.html b/app/templates/index.html index 2caa3bf..da31ed5 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -1,26 +1,6 @@ - - - - - - - - - - - - - - - - Demo - - - +{% extends "base.html" %} +{% block title %}demo{% endblock %} +{% block body %}
- - +{% endblock %} diff --git a/app/templates/login.html b/app/templates/login.html index c970efd..7418d28 100644 --- a/app/templates/login.html +++ b/app/templates/login.html @@ -1,21 +1,10 @@ - - - - - - - - - - Login - - -{% if login_user_form.email.errors or login_user_form.password.errors %} - {% set error_class = " is-danger" %} -{% endif %} - - +{% extends "base.html" %} +{% block title %}login{% endblock %} +{% block body %} + {% if login_user_form.email.errors or login_user_form.password.errors %} + {% set error_class = " is-danger" %} + {% endif %}
@@ -23,7 +12,7 @@
-

Log in to xyz

+

Login to xyz


{{ login_user_form.hidden_tag() }} @@ -68,6 +57,4 @@

Log in to xyz

- - - +{% endblock %} diff --git a/app/templates/register.html b/app/templates/register.html index c42b91b..32becb8 100644 --- a/app/templates/register.html +++ b/app/templates/register.html @@ -1,16 +1,6 @@ - - - - - - - - - - Register - - - +{% extends "base.html" %} +{% block title %}register{% endblock %} +{% block body %}
@@ -44,7 +34,4 @@
- - - - +{% endblock %}