{{ form.media }}
{% if form.non_field_errors %}
  {{form.non_field_errors}}
{% endif %}
{% if form.forms and form.non_form_errors %}
  {{form.non_form_errors}}
{% endif %}
<table
  class="table table-striped table-bordered table-nonfluid"
  {% if table_id %} id="{{table_id}}"{% endif %}
 >
  {{form.show_init}}
  {% if form.forms %}
    {{ form.management_form }}
      <tr>
        {% for field in form.0 %}
          <th {% if field.field.show == False %}class="collapse advanced_params"{% endif %}>
            {{field.label}}{% if field.help_text %}
            <span title="{{ field.help_text}}" class="icon_help">
              <i class="fa fa-question"></i>
            </span>{% endif %}
          </th>
        {% endfor %}
      </tr>
      {% for form in form %}
        {% if form.non_field_errors %}
          <tr><td colspan="30">{{form.non_field_errors}}</td></tr>
        {% endif %}
        <tr>
          {% for field in form %}
            <td {% if field.field.show == False %}class="collapse advanced_params"{% endif %}>
              {{field.errors}} {{field}}
            </td>
          {% endfor %}
        </tr>
      {% endfor %}

  {% else %}
    {% for field in form %}
      <tr {% if field.field.show == False %}class="collapse advanced_params"{% endif %}>
        {% if field.label %}<td>{{field.label_tag}}</td>{% endif%}
        <td{% if not field.label %} colspan="2"{% endif%}>
          {{ field.errors }} {{ field }} {{ field.help_text}}
        </td>
      </tr>
    {% endfor %}
  {% endif %}
</table>


{% spaceless %}
{% if form.forms %}
  {% for f in form %}
    {% include "procmail/form_javascript.html" with form=f %}
  {% endfor %}
{% else %}
  {% include "procmail/form_javascript.html" with form=form %}
{% endif %}
{% endspaceless %}

