{% load redis_metrics_filters %}
<!DOCTYPE html>
<html>
<head>
<title>Redis Metrics</title>
<style type="text/css">
caption {font-weight: bold; font-size: 1.5em;}
table, td {border:1px solid #ccc;}
</style>
</head>
<body>
{% if metrics %}

    {# Generate the HTML for the charts #}
    <h1>Daily Metrics since {{ today }}</h1>

    {% for category, metric_data in metrics.items %}
    <h2>{{ category }}</h2>
    <table>
    <tr><th>Metric</th><th>Values</th></tr>
    {% for slug, values in metric_data %}
      <tr>
      <td>{{ slug }}</td>
      <td><ul>
      {% for k, v in values %}
        <li>{{ k }}: <strong>{{ v }}</strong></li>
      {% endfor %}
      </ul></td>
      </tr>
    {% endfor %}
    {% endfor %}

{% else %}
    <p>You don't have any metrics set up yet!</p>
{% endif %}
</body>
</html>
