{% extends "newbase.html" %}
{% load staticfiles %}
{% load rowerfilters %}

{% block title %}Metric Alert{% endblock %}

{% block main %}

<p>
  <a href="/rowers/alerts/{{ alert.id }}/report/{{ nperiod|add:1 }}/user/{{ rower.user.id }}/">Previous</a>
  {% if nperiod > 0 %}
  <a href="/rowers/alerts/{{ alert.id }}/report/{{ nperiod|add:-1 }}/user/{{ rower.user.id }}/">Next</a>
  {% endif %}
</p>

<ul class="main-content">
  <li>
    {{ stats|lookuplong:'startdate' }} - {{ stats|lookuplong:'enddate' }}
  </li>
  
  <li class="grid_4">
    <h2>{{ alert.name }}</h2>
    <p>{{ alert }}</p>
    <p>{{ alert.description }}</p>
    <p>Managed by {{ alert.manager.first_name }} {{ alert.manager.last_name }}</p>
  </li>
  <li class="rounder">
    <h2>Score</h2>
    <hr>
    <h2>{{ stats|lookup:'percentage' }}%</h2>
  </li>
  <li class="rounder">
    <h2>Data set</h2>
    <hr>
    <p>{{ stats|lookup:'workouts' }} workouts</p>
    <p>{{ stats|lookup:'nr_strokes_qualifying' }} strokes out of {{ stats|lookup:'nr_strokes' }}</p>
  </li>
  <li class="rounder">
    <h2>Statistics</h2>
    <hr>
    <p>Median {{ alert.metricname }}: {{ stats|lookup:'median'|sigdig }}</p>
    <p>Median {{ alert.metricname }}: {{ stats|lookup:'median_q'|sigdig }} ({{ alert.shortdescription }})</p>
  </li>
</ul>


{% endblock %}

{% block sidebar %}
{% include 'menu_analytics.html' %}
{% endblock %}
