{% load wagtailadmin_tags i18n %} {% comment %} Variables this template accepts: id_prefix - A prefix for all id attributes. classname - String of CSS classes to use for the panel. id - Unique to the page. heading - The text of the panel’s heading. heading_size - The size of the heading. heading_level - ARIA override to the default heading level (2). icon - Displayed alongside the heading. id_for_label - id of an associated field. is_required - If the panel contains a required field. children - The panel’s contents. header_controls - Additional panel buttons to display in the header area. {% endcomment %} {% fragment as prefix %}{% if id_prefix %}{{ id_prefix }}-{% endif %}{{ id }}{% endfragment %} {% fragment as panel_id %}{{ prefix }}-section{% endfragment %} {% fragment as heading_id %}{{ prefix }}-heading{% endfragment %} {% fragment as content_id %}{{ prefix }}-content{% endfragment %}
{# If a panel has no heading nor header controls, we don’t want any of the associated UI. #} {% if heading or header_controls %}
{% icon name="link" classname="w-panel__icon" %} {% if heading %}

{% if id_for_label %} {% else %} {{ heading }}{% if is_required %}*{% endif %} {% endif %}

{% endif %} {% icon name="link" classname="w-panel__icon" %}
{% if header_controls %}
{% icon name="dots-horizontal" classname="w-panel__icon" %}
{{ header_controls }}
{% endif %}
{% endif %}
{{ children }}