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

{% block title %}Planned Sessions{% endblock %}

{% block content %}
<div class="grid_12 alpha">
  {% include "planningbuttons.html" %}
</div>
<div class="grid_6 alpha">
  <h1>Plan for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>
  <p>
    From {{ startdate }} to {{ enddate }}
  </p>
</div>
<div id="timeperiod" class="grid_2 dropdown">
  <button class="grid_2 alpha button gray small dropbtn">Select Time Period ({{ timeperiod|verbosetimeperiod }})</button>
  <div class="dropdown-content">
    <a class="button gray small alpha"
       href="/rowers/sessions/print/today/rower/{{ rower.id }}">
      Today
    </a>
    <a class="button gray small alpha"
       href="/rowers/sessions/print/thisweek/rower/{{ rower.id }}">
      This Week
    </a>
    <a class="button gray small alpha"
       href="/rowers/sessions/print/thismonth/rower/{{ rower.id }}">
      This Month
    </a>
    <a class="button gray small alpha"
       href="/rowers/sessions/print/lastweek/rower/{{ rower.id }}">
      Last Week
    </a>
    <a class="button gray small alpha"
       href="/rowers/sessions/print/lastmonth/rower/{{ rower.id }}">
      Last Month
    </a>
    <a class="button gray small alpha"
       href="/rowers/sessions/print/nextweek/rower/{{ rower.id }}">
      Next Week
    </a>
    <a class="button gray small alpha"
       href="/rowers/sessions/print/nextmonth/rower/{{ rower.id }}">
      Next Month
    </a>
  </div>
</div>
{% if user.is_authenticated and user|is_manager %}
<div class="grid_2 dropdown">
  <button class="grid_2 alpha button green small dropbtn">
    {{ rower.user.first_name }} {{ rower.user.last_name }}
  </button>
  <div class="dropdown-content">
    {% for member in user|team_rowers %}
    <a class="button green small" href="/rowers/sessions/print/{{ timeperiod }}/rower/{{ member.id }}">{{ member.user.first_name }} {{ member.user.last_name }}</a>
    {% endfor %}
  </div>
</div>
{% endif %}
<div class="grid_2 omega">
  <a class="button small gray" href="/rowers/list-courses">Courses</a>
</div>
{% for ps in plannedsessions %}
<div class="grid_12 alpha"  style="page-break-before: always, page-break-inside: avoid">
  <h1><a href="/rowers/sessions/{{ ps.id }}">Session {{ ps.name }}</a></h1>
  <table class="listtable shortpadded" width="80%">
    <tr>
      <th>On or after</th><td>{{ ps.startdate }}</td>
    </tr>
    <tr>
      <th>On or before</th><td>{{ ps.enddate }}</td>
    </tr>
    <tr>
      <th>Session Type</th><td>{{ ps.sessiontype }}</td>
    </tr>
    <tr>
      <th>Session Mode</th><td>{{ ps.sessionmode }}</td>
    </tr>
    <tr>
      <th>Criteria</th><td>{{ ps.criterium }}</td>
    </tr>
    <tr>
      <th>Value</th><td>{{ ps.sessionvalue }}</td>
    </tr>
    <tr>
      <th>Unit</th><td>{{ ps.sessionunit }}</td>
    </tr>
    <tr>
      <th>Comment</th><td>{{ ps.comment|linebreaks }}</td>
    </tr>
  </table>
</div>
{% endfor %}

  


{% endblock %}
