From c44de5e2d76225d8edd7467df1fac31305ce449b Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 19 Jan 2020 14:47:51 +0100 Subject: [PATCH] Grouped common CSS and JS includes into separate templates --- .../backend/http/templates/css-common.html | 5 +++++ platypush/backend/http/templates/dashboard.html | 13 ++----------- platypush/backend/http/templates/index.html | 17 ++--------------- platypush/backend/http/templates/js-common.html | 11 +++++++++++ platypush/backend/http/templates/login.html | 4 +--- platypush/backend/http/templates/register.html | 4 +--- .../backend/http/templates/settings/index.html | 11 ++--------- 7 files changed, 24 insertions(+), 41 deletions(-) create mode 100644 platypush/backend/http/templates/css-common.html create mode 100644 platypush/backend/http/templates/js-common.html diff --git a/platypush/backend/http/templates/css-common.html b/platypush/backend/http/templates/css-common.html new file mode 100644 index 00000000..cd882722 --- /dev/null +++ b/platypush/backend/http/templates/css-common.html @@ -0,0 +1,5 @@ + + + + diff --git a/platypush/backend/http/templates/dashboard.html b/platypush/backend/http/templates/dashboard.html index 0bb43bc3..60593546 100644 --- a/platypush/backend/http/templates/dashboard.html +++ b/platypush/backend/http/templates/dashboard.html @@ -3,20 +3,11 @@ Platypush Dashboard - - - - + {% include 'css-common.html' %} - - - - - - - + {% include 'js-common.html' %} diff --git a/platypush/backend/http/templates/index.html b/platypush/backend/http/templates/index.html index a0e7d317..d7a7fce5 100644 --- a/platypush/backend/http/templates/index.html +++ b/platypush/backend/http/templates/index.html @@ -4,10 +4,7 @@ - - - + {% include 'css-common.html' %} - {% if utils.isfile(static_folder, 'js', 'lib', 'vue.js') %} - - {% else %} - - {% endif %} - - - - - - + {% include 'js-common.html' %} {% for style in styles.values() %} diff --git a/platypush/backend/http/templates/js-common.html b/platypush/backend/http/templates/js-common.html new file mode 100644 index 00000000..1182782f --- /dev/null +++ b/platypush/backend/http/templates/js-common.html @@ -0,0 +1,11 @@ +{% if utils.isfile(static_folder, 'js', 'lib', 'vue.js') %} + +{% else %} + +{% endif %} + + + + + + diff --git a/platypush/backend/http/templates/login.html b/platypush/backend/http/templates/login.html index 173a5b8c..42e177a9 100644 --- a/platypush/backend/http/templates/login.html +++ b/platypush/backend/http/templates/login.html @@ -2,9 +2,7 @@ Platypush login page - - - + {% include 'css-common.html' %} diff --git a/platypush/backend/http/templates/register.html b/platypush/backend/http/templates/register.html index 48dd4a5b..45f025be 100644 --- a/platypush/backend/http/templates/register.html +++ b/platypush/backend/http/templates/register.html @@ -2,9 +2,7 @@ Platypush registration page - - - + {% include 'css-common.html' %} diff --git a/platypush/backend/http/templates/settings/index.html b/platypush/backend/http/templates/settings/index.html index 486748f0..2f022f17 100644 --- a/platypush/backend/http/templates/settings/index.html +++ b/platypush/backend/http/templates/settings/index.html @@ -4,9 +4,7 @@ - - - + {% include 'css-common.html' %} - - - - - - + {% include 'js-common.html' %} {% include 'elements.html' %}