{% load i18n %}

<fieldset class="grp-module module {{ fieldset.classes }}">
  {% if fieldset.name %}<h2 class="grp-collapse-handler">{{ fieldset.name }} Mass Edit</h2>{% endif %}
  {% if fieldset.description %}<div class="grp-row row"><p class="grp-description">{{ fieldset.description|safe }}</p></div>{% endif %}
  
  {% if general_error %}
    <div class="grp-errors errornote"> {{ general_error}} </div>
  {% endif %}
  
  <table>
    <tr>
      <th>
        {% trans "Mass Update?" %}
      </th>
      <th>
        {% trans "Field" %}
      </th>
    </tr>
    {% for line in fieldset %}
      {% if line.errors %}
        <tr>
          <td colspan="2">
            {{ line.errors }}
          </td>
        </tr>
      {% endif %}
      
      {% for field in line %}
        <tr>
          {% if field.field.name in adminform.readonly_fields %}
            <td>
              
            </td>
            <td>
              {{ field.field.name }} {% trans "is read only." %}
            </td>
          {% else %}{% if field.field.name in unique_fields %}
            <td>
              
            </td>
            <td>
              {{ field.field.name }} {% trans "is unique." %}
            </td>
          {% elif not field.field.name in exclude_fields %}
            <td style="vertical-align: middle;">
              <input type="checkbox" class="update_checkbox" name="_mass_change" value="{{ field.field.name }}"
                {% if field.field.name in mass_changes_fields %}checked{% endif %} />
            </td>
            <td>
              {% if field.is_checkbox %}
                {{ field.field }}{{ field.label_tag }}
              {% else %}
                <div>
                  {{ field.label_tag }}
                </div>
                <div>
                  {{ field.field }}
                </div>
              {% endif %}
              {% if field.field.field.help_text %}<p class="help">{{ field.field.field.help_text|safe }}</p>{% endif %}
            </td>
          {% endif %}{% endif %}
        </tr>
      {% endfor %}
    {% endfor %}
  </table>
</fieldset>