diff --git a/reports/templates/reports/diaperchange_lifetimes.html b/reports/templates/reports/diaperchange_lifetimes.html index e12a6df4..fb828e72 100644 --- a/reports/templates/reports/diaperchange_lifetimes.html +++ b/reports/templates/reports/diaperchange_lifetimes.html @@ -6,8 +6,3 @@ {{ block.super }} {% endblock %} - -{% block javascript %} - {{ block.super }} - {{ javascript|safe }} -{% endblock %} \ No newline at end of file diff --git a/reports/templates/reports/diaperchange_types.html b/reports/templates/reports/diaperchange_types.html index 59757023..be74ebb9 100644 --- a/reports/templates/reports/diaperchange_types.html +++ b/reports/templates/reports/diaperchange_types.html @@ -6,8 +6,3 @@ {{ block.super }} {% endblock %} - -{% block javascript %} - {{ block.super }} - {{ javascript|safe }} -{% endblock %} \ No newline at end of file diff --git a/reports/templates/reports/feeding_duration.html b/reports/templates/reports/feeding_duration.html index bc9f7b2c..bd216360 100644 --- a/reports/templates/reports/feeding_duration.html +++ b/reports/templates/reports/feeding_duration.html @@ -6,8 +6,3 @@ {{ block.super }} {% endblock %} - -{% block javascript %} - {{ block.super }} - {{ javascript|safe }} -{% endblock %} \ No newline at end of file diff --git a/reports/templates/reports/report_base.html b/reports/templates/reports/report_base.html index 97744376..92065b73 100644 --- a/reports/templates/reports/report_base.html +++ b/reports/templates/reports/report_base.html @@ -25,4 +25,6 @@ {% block javascript %} + {{ js_graph|safe }} + {{ js_listener|safe }} {% endblock %} \ No newline at end of file diff --git a/reports/templates/reports/sleep_pattern.html b/reports/templates/reports/sleep_pattern.html index cd206dba..1b457a89 100644 --- a/reports/templates/reports/sleep_pattern.html +++ b/reports/templates/reports/sleep_pattern.html @@ -6,8 +6,3 @@ {{ block.super }} {% endblock %} - -{% block javascript %} - {{ block.super }} - {{ javascript|safe }} -{% endblock %} \ No newline at end of file diff --git a/reports/templates/reports/sleep_totals.html b/reports/templates/reports/sleep_totals.html index 0223d63f..e5475436 100644 --- a/reports/templates/reports/sleep_totals.html +++ b/reports/templates/reports/sleep_totals.html @@ -6,8 +6,3 @@ {{ block.super }} {% endblock %} - -{% block javascript %} - {{ block.super }} - {{ javascript|safe }} -{% endblock %} \ No newline at end of file diff --git a/reports/templates/reports/weight_change.html b/reports/templates/reports/weight_change.html index add911d1..72c75a3e 100644 --- a/reports/templates/reports/weight_change.html +++ b/reports/templates/reports/weight_change.html @@ -6,8 +6,3 @@ {{ block.super }} {% endblock %} - -{% block javascript %} - {{ block.super }} - {{ javascript|safe }} -{% endblock %} \ No newline at end of file diff --git a/reports/utils.py b/reports/utils.py index cab5e3ca..44ac2136 100644 --- a/reports/utils.py +++ b/reports/utils.py @@ -82,6 +82,7 @@ def split_graph_output(output): :param output: a string of html and javascript comprising the graph. :returns: a tuple of the the graph's html and javascript. """ - html, javascript = output.split(' 1: - context['html'], context['javascript'] = \ + context['html'], context['js_graph'], context['js_listener'] = \ graphs.diaperchange_lifetimes(changes) return context @@ -40,7 +40,7 @@ class DiaperChangeTypesChildReport(PermissionRequired403Mixin, DetailView): child = context['object'] changes = models.DiaperChange.objects.filter(child=child) if changes: - context['html'], context['javascript'] = \ + context['html'], context['js_graph'], context['js_listener'] = \ graphs.diaperchange_types(changes) return context @@ -64,7 +64,7 @@ class FeedingDurationChildReport(PermissionRequired403Mixin, DetailView): child = context['object'] instances = models.Feeding.objects.filter(child=child) if instances: - context['html'], context['javascript'] = \ + context['html'], context['js_graph'], context['js_listener'] = \ graphs.feeding_duration(instances) return context @@ -88,7 +88,7 @@ class SleepPatternChildReport(PermissionRequired403Mixin, DetailView): child = context['object'] instances = models.Sleep.objects.filter(child=child).order_by('start') if instances: - context['html'], context['javascript'] = \ + context['html'], context['js_graph'], context['js_listener'] = \ graphs.sleep_pattern(instances) return context @@ -112,7 +112,7 @@ class SleepTotalsChildReport(PermissionRequired403Mixin, DetailView): child = context['object'] instances = models.Sleep.objects.filter(child=child).order_by('start') if instances: - context['html'], context['javascript'] = \ + context['html'], context['js_graph'], context['js_listener'] = \ graphs.sleep_totals(instances) return context @@ -131,6 +131,6 @@ class WeightWeightChildReport(PermissionRequired403Mixin, DetailView): child = context['object'] objects = models.Weight.objects.filter(child=child) if objects: - context['html'], context['javascript'] = \ + context['html'], context['js_graph'], context['js_listener'] = \ graphs.weight_weight(objects) return context