{% extends "admin/base_site.html" %}
{% load i18n admin_urls admin_static admin_modify %}
{% block extrahead %}{{ block.super }}
    <script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
    {{ media }}
{% endblock %}

{% block extrastyle %}{{ block.super }}
    <link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}"/>{% endblock %}

{% block coltype %}colM{% endblock %}

{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %}

{% block breadcrumbs %}
    <div class="breadcrumbs">
        <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
        &rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
        &rsaquo; {% if has_change_permission %}
        <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}
        {{ opts.verbose_name_plural|capfirst }}{% endif %}
        &rsaquo; {% if add %}{% trans 'Repeat task' %} {{ opts.verbose_name }}{% else %}
        {{ original|truncatewords:"18" }}{% endif %}
    </div>
{% endblock %}

{% block content %}
    <div id="content-main">
        <form action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>
            <h1>{% blocktrans %}Repeat the task <strong>{{ obj }}</strong>{% endblocktrans %}</h1>
            <p>{% blocktrans %}The selected task will be copied until the new start times have reached the limit below.
                {% endblocktrans %}</p>
        <table>
            <tr><th>{% trans 'Category:' %}</th><td>{{ obj.category }}</td></tr>
            <tr><th>{% trans 'Start time:' %}</th><td>{{ obj.start_time }}</td></tr>
            <tr><th>{% trans 'End time:' %}</th><td>{{ obj.end_time }}</td></tr>
        </table>
            {% csrf_token %}{% block form_top %}{% endblock %}
            <div>
                {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1"/>{% endif %}

                {% if errors %}
                    <p class="errornote">
                        {% if errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}
                            {% trans "Please correct the errors below." %}{% endif %}
                    </p>
                    {{ form.non_field_errors }}
                {% endif %}
                <table>{{ form.as_table }}</table>
                {{ form.media }}

                <div class="submit-row">
                    <input type="submit" value="{% trans 'Repeat this task!' %}" class="default" name="_save"/>
                </div>

                {# JavaScript for prepopulated fields #}
                {% prepopulated_fields_js %}

            </div>
        </form>
    </div>
{% endblock %}
