{% load static %} {% comment %} Context for this Template: * ``chart_id`` -- the id attribute used for the element * ``slugs`` -- a set of slugs for the metrics that we want to aggregate. * ``with_data_table`` -- True or False; whether or not to show raw metric data in a table. * ``metrics`` -- the metric data. It's a list of two-tuples that looks something like this:: [ ('foo', { 'seconds': 0, 'minutes': 0, 'hours': 4, 'day': '42', 'month': '90', 'week': '50', 'year': '9991' }), ('bar', { 'seconds': 0, 'minutes': 0, 'hours': 4, 'day': '42', 'month': '10', 'week': '5', 'year': '90' }) ] {% endcomment %}
{% if with_data_table %} {% for slug, metric_dict in metrics %} {% for period, value in metric_dict.items %} {% endfor %} {% endfor %}
Metric Data for {{ slugs|join:", " }}
MetricTime PeriodValue
{{ slug }} {{ period|capfirst }} {{ value|default_if_none:"-" }}
{% endif %}