{% extends "admin/change_form.html" %}
{% load i18n admin_modify actions massupdate static %}
{% block extrahead %}{{ block.super }}
<style type="text/css">
  #col1 {
    float: left;
    width: 70%;
  }

  #col2 {
    float: right;
    width: 30%;
  }

  #col2 select {
    width: 100%;
  }
</style>
{{ media }}
{% endblock %}

{% block breadcrumbs %}{% if not is_popup %}
<div class="breadcrumbs">
  <a href="../../">{% trans "Home" %}</a> &rsaquo;
  <a href="../">{{ app_label|capfirst|escape }}</a> &rsaquo;
  <a href=".">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo;
  {{ action_short_description|capfirst }}
</div>
{% endif %}{% endblock %}

{% block content %}
{% if form.subject.errors %}
<ol>
  {% for error in form.subject.errors %}
  <li><strong>{{ error|escape }}</strong></li>
  {% endfor %}
</ol>
{% endif %}
{{ form.non_field_errors }}
<div id='col1'>
  <form action="" method="post">
    {% csrf_token %}
    <table border="1">
      <tr>
        <th>{% trans "field name" %}</th>
        <th>{% trans "update" %}</th>
        <th>{% trans "function" %}</th>
        <th>{% trans "new value" %}</th>
        {% if grouped %}
        <th>{% trans "existing values" %}
        </th>
        {% endif %}
      </tr>
      {% for field in adminform.form.model_fields %}
      <tr class="{{ field.name }}-row">
        <td>{% if field.field.required %}
          <b>{% endif %} {{ field.label_tag }}{% if field.field.required %}</b>{% endif %}
        </td>
        <td class='col_enabler'>{% checkbox_enabler field %}</td>
        <td class='col_func field-{{ field.name }}-op'>
          {% field_function adminform.model_admin.model field %}&nbsp;
        </td>
        <td class='col_field field-{{ field.name }}-value'>{{ field.errors }}
          {{ field }}&nbsp;
        </td>
        {% if grouped %}
        <td class='field-{{ field.name }}-commonvalues'>
          {% link_fields_values grouped field.name %}
        </td>
        {% endif %}

      </tr>
      {% endfor %}
    </table>
    {% for hidden in form.hidden_fields %}
    {{ hidden }}
    {% endfor %}
    <input style="margin: 5px;" type="submit" name="apply" value="{% trans 'Update ' %}{{ selection.count }}{% trans ' records' %}"/>
  </form>
</div>
{% endblock %}
