{% load 'admin_modify' %}
{% extends "admin/base_site.html" %}

{% block extrahead %}{{ super() }}
{% set jsi18nurl = url('admin:jsi18n') %}
<script type="text/javascript" src="{{ jsi18nurl|default("../../../jsi18n/") }}"></script>
{{ media }}
{% endblock %}

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

{% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}

{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}

{% block breadcrumbs %}{% if not is_popup %}
<div class="breadcrumbs">
     <a href="../../../">{{ _("Home") }}</a> &rsaquo;
     <a href="../../">{{ app_label|capitalize|escape }}</a> &rsaquo;
     {% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capitalize }}</a>{% else %}{{ opts.verbose_name_plural|capitalize }}{% endif %} &rsaquo;
     {% if add %}{{ _("Add") }} {{ opts.verbose_name }}{% else %}{{ original|string|wordwrap(18) }}{% endif %}
</div>
{% endif %}{% endblock %}

{% block content %}<div id="content-main">
{% block objecttools %}
{% if change %}{% if not is_popup %}
  <ul class="object-tools">
    {% block objecttoolsitems %}
    <li><a href="history/" class="historylink">{{ _("History") }}</a></li>
    {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{{ _("View on site") }}</a></li>{% endif%}
    {% endblock %}
  </ul>
{% endif %}{% endif %}
{% endblock %}
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
{% if save_on_top %}{{submit_row()}}
{#% submit_row %#}{% endif %}
{% if errors %}
    <p class="errornote">
    {% trans count=errors|length %}Please correct the error below.{% pluralize %}Please correct the errors below.{% endtrans %}
    </p>
    {{ adminform.form.non_field_errors() }}
{% endif %}

{% block field_sets %}
{% for fieldset in adminform %}
  {% include "admin/includes/fieldset.html" %}
{% endfor %}
{% endblock %}

{% block after_field_sets %}{% endblock %}

{% block inline_field_sets %}
{% for inline_admin_formset in inline_admin_formsets %}
    {% include inline_admin_formset.opts.template %}
{% endfor %}
{% endblock %}

{% block after_related_objects %}{% endblock %}
{{submit_row()}}
{#% submit_row %#}

{% if adminform and add %}
   <script type="text/javascript">document.getElementById("{{ adminform.first_field.id_for_label }}").focus();</script>
{% endif %}

{# JavaScript for prepopulated fields #}
{{prepopulated_fields_js()}}

{#% prepopulated_fields_js %#}

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