{% extends extend_template %}
{% load i18n static wger_extras %}


<!--
        Title
-->

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


<!--
        Header
-->
{% block header %}
<script>
$(document).ready(function() {
    wgerInitEditSet();
});
</script>
{% endblock %}

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

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

    {% csrf_token %}
    {% render_form_field form.categories_list %}
    {% render_form_field form.exercise_list %}
    <div class="form-group">
    <div class="col-md-offset-3 col-md-9">
        <div id="exercise-search-log"></div>
    </div>
    </div>

    <div class="form-group">
        <label for="id_sets" class="control-label col-md-3">
            {{form.sets.label}}
            - <span id="id_sets_value">{{ form.sets.value }}</span>
        </label>
        <div class="col-md-9">
            <input name="sets"
                   id="id_sets"
                   min="1"
                   max="10"
                   value="{{ form.sets.value }}"
                   type="range"
                   class="form-control">
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-offset-3 col-md-9">
            <span class="text-muted">{% blocktrans %}If you do the same repetitions for all sets,
you can just enter one value: e.g. for 4 sets just enter one "10" for the repetitions, this
automatically becomes "4 x 10".{% endblocktrans %}</span>
        </div>
    </div>


    <div class="form-group">
        <div class="col-md-offset-3 col-md-9" id="formsets">
            {% for formset in formsets %}
                    {% include 'set/formset.html' with exercise=formset.exercise formset=formset.formset %}
            {% endfor %}
        </div>
    </div>
    {% render_form_submit %}
</form>
{% endblock %}
