{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% load staticfiles %}
{% load manager_extras %}


<!--
        Title
-->

{% block title %}{% with day_name=day.description %}{% blocktrans %}Add exercises to day "{{day_name}}"{% endblocktrans %}{% endwith %}{% endblock %}


<!--
        Header
-->
{% block header %}
<script>
function custom_page_init()
{
    init_edit_set();
}
</script>
{% endblock %}

<!--
        Main Content
-->
{% block content %}


<form action="{{form_action}}"
      method="post"
      class="ym-form">

{% csrf_token %}
<table>
    {% yaml_form_field form.exercises %}
    <tr>
        <td style="text-align:right;">
            <label for="slider">{{form.sets.label}}</label>
        </td>
        <td>
            <div id="slider"></div>
            <span id="slider-show">{{form.sets.value}}</span>
            <input type="hidden" id="id_sets" name="sets" value="{{ form.sets.value }}">
        </td>
    </tr>

    <tr>
        <td colspan="2">
            <div id="formsets">
            {% for formset in formsets %}
                    {% include 'set/formset.html' with exercise=formset.exercise formset=formset.formset %}
            {% endfor %}
            </div>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <input type="submit" value="{% trans 'Save' %}" id="form-save">
        </td>
    </tr>
</table>

{% endblock %}