From 936814222d1ec64ec03cffc237693e16f9564d58 Mon Sep 17 00:00:00 2001 From: Mike Terzo Date: Thu, 26 Jan 2017 17:30:58 -0500 Subject: [PATCH] Refactor JSON to be in the html/head tag instead of at the footer --- puppetboard/templates/index.html | 14 ++++---- puppetboard/templates/layout.html | 57 ++++++++++++++++-------------- puppetboard/templates/node.html | 18 +++++----- puppetboard/templates/reports.html | 6 ++-- 4 files changed, 48 insertions(+), 47 deletions(-) diff --git a/puppetboard/templates/index.html b/puppetboard/templates/index.html index fee5fd7..d77195a 100644 --- a/puppetboard/templates/index.html +++ b/puppetboard/templates/index.html @@ -4,6 +4,13 @@ {% if config.DAILY_REPORTS_CHART_ENABLED %} {% endif %} +{% if config.DAILY_REPORTS_CHART_ENABLED %} +{% block script %} + + + +{% endblock script %} +{% endif %} {% endblock head %} {% block content %} {% if config.REFRESH_RATE > 0 %} @@ -124,10 +131,3 @@ {% endblock content %} -{% if config.DAILY_REPORTS_CHART_ENABLED %} -{% block script %} - - - -{% endblock script %} -{% endif %} diff --git a/puppetboard/templates/layout.html b/puppetboard/templates/layout.html index 0c69f1e..ab9f649 100644 --- a/puppetboard/templates/layout.html +++ b/puppetboard/templates/layout.html @@ -19,6 +19,36 @@ {% endif %} + + {% if config.OFFLINE_MODE %} + + + + {% if config.LOCALISE_TIMESTAMP %} + + {% endif %} + {% else %} + + + + {% if config.LOCALISE_TIMESTAMP %} + + {% endif %} + {% endif %} + {% if config.LOCALISE_TIMESTAMP %} + + {% endif %} + + + + + {% block script %} {% endblock script %} {% block head %} {% endblock head %} @@ -70,32 +100,5 @@ Copyright © 2013-{{ now('%Y') }} Puppet Community. Live from PuppetDB. - - {% if config.OFFLINE_MODE %} - - - - {% if config.LOCALISE_TIMESTAMP %} - - {% endif %} - {% else %} - - - - {% if config.LOCALISE_TIMESTAMP %} - - {% endif %} - {% endif %} - {% if config.LOCALISE_TIMESTAMP %} - - {% endif %} - - - - - - {% block script %} {% endblock script %} diff --git a/puppetboard/templates/node.html b/puppetboard/templates/node.html index aff015a..e052f23 100644 --- a/puppetboard/templates/node.html +++ b/puppetboard/templates/node.html @@ -4,6 +4,15 @@ {% if config.DAILY_REPORTS_CHART_ENABLED %} {% endif %} +{% block script %} + +{% if config.DAILY_REPORTS_CHART_ENABLED %} + + + +{% endif %} {% endblock head %} {% block content %}
@@ -58,13 +67,4 @@
{% endblock content %} -{% block script %} - -{% if config.DAILY_REPORTS_CHART_ENABLED %} - - - -{% endif %} {% endblock script %} diff --git a/puppetboard/templates/reports.html b/puppetboard/templates/reports.html index 79bad44..1d16d03 100644 --- a/puppetboard/templates/reports.html +++ b/puppetboard/templates/reports.html @@ -28,12 +28,11 @@ {% endblock content %} -{% block script %} +{% block onload_script %} {% macro extra_options(caller) %} // No initial loading "deferLoading": true, {% endmacro %} - -{% endblock script %} +{% endblock onload_script %}