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

{% block title %}Workouts{% endblock %}

{% block content %}
<h1>Available on C2 Logbook</h1>
{% if data %}
<table width="70%" class="listtable">
  <thead>
    <tr>
      <th> Distance </th>
      <th> Duration </th>
      <th> Date</th>
      <th> Type</th>
      <th> Import</th>
    </tr>
  </thead>
  <tbody>
    {% for workout in data %}
    <tr>
      {% for key,value in workout.items %}
      {% if key == "date" %}
      <td>{{ value }}</td>
      {% endif %}
      {% if key == "type" %}
      <td>{{ value }}</td>
      {% endif %}
      {% if key == "distance" %}
      <td>{{ value }}m</td>
      {% endif %}
      {% if key == "time_formatted" %}
      <td>{{ value }}</td>
      {% endif %}
      {% if key == "id" %}
      <td><a href="/rowers/workout/c2import/{{ value }}/">Import</a></td>
      {% endif %}
      {% endfor %}
    </tr>
    
    {% endfor %}
  </tbody>
</table>
{% else %}
<p> No workouts found </p>
{% endif %}
{% endblock %}

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