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

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

{% block main %}
<h1>Plan for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>

{% for ps in plannedsessions %}
  <h2><a href="/rowers/sessions/{{ ps.id }}">Session {{ ps.name }}</a></h2>
  <table class="listtable shortpadded" width="80%">
    <tr>
      <th align="left">On or after</th><td>{{ ps.startdate }}</td>
    </tr>
    <tr>
      <th align="left">On or before</th><td>{{ ps.enddate }}</td>
    </tr>
    <tr>
      <th align="left">Session Type</th><td>{{ ps.sessiontype }}</td>
    </tr>
    <tr>
      <th align="left">Session Mode</th><td>{{ ps.sessionmode }}</td>
    </tr>
    <tr>
      <th align="left">Criteria</th><td>{{ ps.criterium }}</td>
    </tr>
    <tr>
      <th align="left">Value</th><td>{{ ps.sessionvalue }}</td>
    </tr>
    <tr>
      <th align="left">Unit</th><td>{{ ps.sessionunit }}</td>
    </tr>
    <tr>
      <th align="left">Comment</th><td>{{ ps.comment|linebreaks|urlshorten:"50" }}</td>
    </tr>
  </table>
{% endfor %}


{% if not user.is_anonymous %}
<p>
<form enctype="multipart/form-data" action="/rowers/access/share/" method="post">
  {% csrf_token %}
  <input name="url" value="/rowers/sessions/print/user/{{ rower.user.id }}/{{ timeperiod }}/" type="hidden">
  <label for="id_ndays">Number of days link is valid:</label>
  <input name="ndays" id="id_ndays" type="number" step="1" value="7">
  <input type="submit" value="create shareable link">
</form>
</p>
{% endif %}

{% endblock %}

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