{% load i18n autoplanner %}
<form id="taskMultiplyForm" onsubmit="return $.df.call('autoplanner.forms.task_multiply', {form: $(this).serializeArray(), organization_pk: {{ organization.id|my_simple_str }}, task_pk: {{ task.pk }} })">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">{% trans 'Duplicate an existing task' %} / {{ task.name}}</h4>
    </div>

    <div class="modal-body">
        <p class="well">
            {% blocktrans %}You can repeat this task until the starting time of the new tasks reaches your limit.{% endblocktrans %}
        </p>

        <table class="datetime">
            <tr>
                <td>{% trans 'Date' %}&nbsp;: <input type="text" name="until_0" value="{{ task.end_time|input_date }}"
                                                     class="form-control vDateField" size="10"></td>
                <td>{% trans 'Time' %}&nbsp;: <input type="text" name="until_1" value="{{ task.end_time|input_time }}"
                                                     class="form-control vTimeField" size="8"></td>
            </tr>
        </table>

        <hr>
        <p>{% trans 'Please specify the number of days between two successive tasks. This interval is between the start of these tasks.' %}</p>
        <div class="form-group">
            <label for="multiplyTaskInterval">{% trans 'Interval (days):' %}</label>
            <input id="multiplyTaskInterval" type="number" class="form-control" name="every" value="7"
                   style="width: 8em;">
        </div>
    </div>
    <div class="modal-footer">
        <div class="btn-group">
            <input type="submit" class="btn btn-success" value="{% trans 'Repeat this task' %}"/>
            <button type="button" class="btn btn-default" data-dismiss="modal">{% trans 'Close' %}</button>
        </div>
    </div>
</form>
<script type="application/javascript">
    DateTimeShortcutsReinit('#taskMultiplyForm');
</script>
