{% extends "djblets_forms/admin/base_site.html" %}
{% load admin_list i18n pipeline staticfiles %}

{% block title %}
{%  block page_title %}{{form.Meta.title}}{% endblock %} {{block.super}}
{% endblock %}

{% block extrahead %}
{%  url 'admin:jsi18n' as jsi18nurl %}
<script src="{% url 'admin:jsi18n' %}"></script>
{{block.super}}
{% endblock extrahead %}


{% block admin_css %}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />
{%  stylesheet "djblets-admin" %}
{%  stylesheet "djblets-forms" %}

{%  if media %}
{{media.css}}
{%  elif form.media %}
{{form.media.css}}
{%  endif %}

{%  for bundle_name in form.css_bundle_names %}
{%   stylesheet bundle_name %}
{%  endfor %}
{{block.super}}
{% endblock admin_css %}


{% block admin_scripts_post %}
{%  for bundle_name in form.js_bundle_names %}
{%   javascript bundle_name %}
{%  endfor %}
{{block.super}}

{%  javascript "djblets-forms" %}
{%  if media %}
{{media.js}}
{%  elif form.media %}
{{form.media.js}}
{%  endif %}
{% endblock admin_scripts_post %}


{% block bodyclass %}{{block.super}} change-form{% endblock %}


{% block content %}
{%  if form.errors %}
 <p class="errornote">
  {% blocktrans count form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
 </p>
{%  endif %}

{%  if saved %}
 <ul class="messagelist">
  <li>
{%   block save_message %}
{%    trans "The settings have been saved." %}
{%   endblock save_message %}
  </li>
 </ul>
{%  endif %}

 <h1 class="title">{% block form_title %}{{form.Meta.title}}{% endblock %}</h1>

<div id="content-main">
 <form action="." method="post"{% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>
  {% csrf_token %}
{%  block form_content %}
{%   include "djblets_forms/admin/form_fieldsets.html" %}
{%  endblock %}

{%  block submit_row %}
  <div class="submit-row">
{%   block submit_row_buttons %}
   <input type="submit" value="{% trans "Save" %}" class="default" />
{%   endblock submit_row_buttons %}
   <div style="clear: both"></div>
  </div>
{%  endblock submit_row %}

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