{# Render a fieldset with optional legend and description #}
{% load djadmin_layout %}

<fieldset{% if fieldset.css_classes %} class="{{ fieldset.css_classes|join:' ' }}"{% endif %}>
    {% if fieldset.legend %}
        <legend>{{ fieldset.legend }}</legend>
    {% endif %}

    {% if fieldset.description %}
        <p>{{ fieldset.description }}</p>
    {% endif %}

    {% for item in fieldset.fields %}
        {% render_layout_item item %}
    {% endfor %}
</fieldset>
