{% load djblets_forms %}

{% block pre_fields %}{% endblock %}

{% for field in form %}
{%  if field.is_hidden %}
{{field}}
{%  else %}
{%   with field|form_field_has_label_first as label_first %}
<div class="fields-row{% if not label_first %} checkbox-row{% endif %}">
 <div class="field">
{%    if label_first %}
  {% label_tag field %}
  {{field}}
{%    else %}
  {{field}}
  {% label_tag field %}
{%    endif %}
  {{field.errors}}
 </div>
</div>
{%   endwith %}
{%  endif %}
{% endfor %}

{% block post_fields %}{% endblock %}

{% if form.save_label %}
<input type="submit" clas="btn" value="{{form.save_label}}" />
{% endif %}
