Further standardize report templates.

This commit is contained in:
Christopher Charbonneau Wells 2017-09-13 11:20:28 -04:00
parent f89a8ce289
commit 6cfbba5f81
5 changed files with 17 additions and 31 deletions

View File

@ -17,12 +17,12 @@
aria-expanded="false"><i class="fa fa-bar-chart" aria-hidden="true"></i> Reports</button> aria-expanded="false"><i class="fa fa-bar-chart" aria-hidden="true"></i> Reports</button>
<div class="dropdown-menu" aria-labelledby="reports-dropdown"> <div class="dropdown-menu" aria-labelledby="reports-dropdown">
{% if perms.core.view_diaperchange %} {% if perms.core.view_diaperchange %}
<a class="dropdown-item" href="{% url 'reports:report-diaperchange-child' object.slug %}"> <h6 class="dropdown-header"><i class="fa fa-trash" aria-hidden="true"></i> Diaper Changes</h6>
<i class="fa fa-trash" aria-hidden="true"></i> Changes</a> <a class="dropdown-item" href="{% url 'reports:report-diaperchange-child' object.slug %}">Change Types</a>
{% endif %} {% endif %}
{% if perms.core.view_sleep %} {% if perms.core.view_sleep %}
<a class="dropdown-item" href="{% url 'reports:report-sleep-child' object.slug %}"> <h6 class="dropdown-header"><i class="fa fa-bed" aria-hidden="true"></i> Sleep</h6>
<i class="fa fa-bed" aria-hidden="true"></i> Sleep</a> <a class="dropdown-item" href="{% url 'reports:report-sleep-child' object.slug %}">Sleep Patterns</a>
{% endif %} {% endif %}
</div> </div>
</div> </div>

View File

@ -46,7 +46,7 @@ def diaperchange_types(child):
layout_args = default_graph_layout_options() layout_args = default_graph_layout_options()
layout_args['barmode'] = 'stack' layout_args['barmode'] = 'stack'
layout_args['title'] = 'Diaper Change types' layout_args['title'] = '<b>Diaper Change Types</b><br>{}'.format(child)
layout_args['xaxis']['title'] = 'Date' layout_args['xaxis']['title'] = 'Date'
layout_args['yaxis']['title'] = 'Number of changes' layout_args['yaxis']['title'] = 'Number of changes'
@ -173,7 +173,7 @@ def sleep_times(child):
layout_args['barmode'] = 'stack' layout_args['barmode'] = 'stack'
layout_args['hovermode'] = 'closest' layout_args['hovermode'] = 'closest'
layout_args['title'] = 'Sleep vs. wake times' layout_args['title'] = '<b>Sleep Patterns</b><br>{}'.format(child)
layout_args['height'] = 600 layout_args['height'] = 600
layout_args['xaxis']['title'] = 'Date' layout_args['xaxis']['title'] = 'Date'

View File

@ -1,17 +1,6 @@
{% extends 'reports/report_base.html' %} {% extends 'reports/report_base.html' %}
{% block title %}Diaper Change Report - {{ object }}{% endblock %} {% block title %}Diaper Change Types - {{ object }}{% endblock %}
{% block content %}
<div class="jumbotron jumbotron-fluid text-center">
<h1 class="display-3">Diaper Change Reports</h1>
<h2 class="text-muted">{{ object }}</h2>
</div>
<div class="container-fluid">
{{ html|safe }}
</div>
{% endblock %}
{% block javascript %} {% block javascript %}
{{ block.super }} {{ block.super }}

View File

@ -1,6 +1,14 @@
{% extends 'babyblotter/page.html' %} {% extends 'babyblotter/page.html' %}
{% load static %} {% load static %}
{% block title %}{% endblock %}
{% block content %}
<div class="container-fluid">
{{ html|safe }}
</div>
{% endblock %}
{% block javascript %} {% block javascript %}
{% if debug %} {% if debug %}
<script src="{% static "babyblotter/js/graph.js" %}"></script> <script src="{% static "babyblotter/js/graph.js" %}"></script>

View File

@ -1,17 +1,6 @@
{% extends 'reports/report_base.html' %} {% extends 'reports/report_base.html' %}
{% block title %}Sleep Reports - {{ object }}{% endblock %} {% block title %}Sleep Patterns - {{ object }}{% endblock %}
{% block content %}
<div class="jumbotron jumbotron-fluid text-center">
<h1 class="display-3">Sleep Reports</h1>
<h2 class="text-muted">{{ object }}</h2>
</div>
<div class="container-fluid">
{{ html|safe }}
</div>
{% endblock %}
{% block javascript %} {% block javascript %}
{{ block.super }} {{ block.super }}