<fieldset class="{{ fieldset.classes }}">
    {% if fieldset.name %}
        <h2>{{ fieldset.name }}</h2>
    {% endif %}
    
    {% if fieldset.description %}
        <div class="description">{{ fieldset.description|safe }}</div>
    {% endif %}

    {% for line in fieldset %}
        {% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %}
        
        {% for field in line %}
        <div class="control-group {% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} error{% endif %}">

                {% if not field.is_checkbox %}
                    <label class="control-label">
                        {% if field.field.field.required %}
                            <strong>{{ field.field.label }}: *</strong>
                        {% else %}
                            {{ field.field.label }}:
                        {% endif %}
                    </label>
                {% endif %}

                {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}

                <div class="controls{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">

                    {% if field.is_checkbox %}
                        <label class="checkbox">
                            {{ field.field }} {{ field.field.label }}
                        </label>
                    {% else %}
                        {% if field.is_readonly %}
                            <p>{{ field.contents|linebreaksbr }}</p>
                        {% else %}
                            {{ field.field }}
                        {% endif %}
                    {% endif %}

                    {% if field.field.help_text %}
                        <span class="help-inline">{{ field.field.help_text|safe }}</span>
                    {% endif %}
                </div>
        </div>
        {% endfor %}
    {% endfor %}
</fieldset>