{% endif %}
{% for line in fieldset %}
{# Its an ugly hack to hide hidden input fields using style "display: none;", but unless https://code.djangoproject.com/ticket/11277 is solved, it currently the only possible workaround #}
{% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %}
{% for field in line %}
{% if field.field.is_hidden %}{{ field.field }}{% else %}
{% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
{% if field.is_checkbox %}
{{ field.field }}{{ field.label_tag }}
{% else %}
{{ field.label_tag }}
{% if field.is_readonly %}