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


{% get_current_timezone as TIME_ZONE %}


{% block scripts %}

<script type='text/javascript'
        src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
</script>
<script>
$( document ).ready(function() {
    $('#id_workouttype').on('change', function(){
        if (
            $(this).val() == 'water'
            || $(this).val() == 'coastal'
            || $(this).val() == 'c-boat'
            || $(this).val() == 'churchboat'
        ) {
            $('#id_boattype').toggle(true);
        } else {
            $('#id_boattype').toggle(false);
            $('#id_boattype').val('1x');
        }
});
$('#id_workouttype').change();
});
</script>
{% endblock %}

{% block main %}
<h1>Add Manual Workout Entry</h1>
<ul class="main-content">
  <li class="grid_2">
    {% if form.errors %}
    <p style="color: red;">
      Please correct the error{{ form.errors|pluralize }} below.
    </p>
    {% endif %}

    <form id="importantform"
          enctype="multipart/form-data" action="" method="post">
      <table width=100%>
        {{ form.as_table }}
        {{ metricsform.as_table }}
      </table>
      Optional, add image (PM screenshot, for example as evidence for a virtual race):
      <table>
        {{ iform.as_table }}
      </table>
      {% csrf_token %}
      <p>
        <input class="button green" type="submit" value="Save">
      </p>
    </form>
  </li>
</ul>



{% endblock %}

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