4 * Default theme implementation to display a Bootstrap Panel component.
7 * - attributes: An array of HTML attributes intended to be added to the main
8 * container tag of this template.
9 * - id: A valid HTML ID and guaranteed to be unique.
10 * - body: The primary content of the panel.
11 * - body_attributes: (optional) Same as attributes, except applied to the body
12 * container that appears in the template.
13 * - collapsible: Flag indicating whether the panel is collapsible.
14 * - collapsed: Flag indicating whether the panel is collapsed.
15 * - description: (optional) A list of description properties containing:
16 * - content: (optional) A description of the form element, may not be set.
17 * - attributes: (optional) A list of HTML attributes to apply to the
18 * description content wrapper. Will only be set when description is set.
19 * - position: (optional) A display setting that can have these values:
20 * - before: The description is output before the element. This is the
22 * - after: The description is output after the element.
23 * - invisible: The description is output after the element, hidden
24 * visually but available to screen readers.
25 * - errors: (optional) Any errors for panel, may not be set.
26 * - footer: (optional) Additional contents intended to be placed at the bottom.
27 * - footer_attributes: (optional) Same as attributes, except applied to the
28 * footer container that appears in the template.
29 * - heading: (optional) The title of the panel, may not be set.
30 * - heading_attributes: (optional) Same as attributes, except applied to the
31 * heading container that appears in the template.
32 * - panel_type: (optional) A contextual state. Will be one of these values:
34 * - default (default value)
39 * - target: (optional) The target of the collapsible container.
47 errors ? 'panel-danger' : 'panel-' ~ panel_type|clean_class,
50 <div{{ attributes.addClass(classes) }}>
55 <div class="panel-heading">
57 set heading_classes = [
59 required ? 'form-required' : '',
63 <a{{ heading_attributes.addClass(heading_classes) }} href="{{ target }}">{{ heading }}</a>
65 <div{{ heading_attributes.addClass(heading_classes) }}>{{ heading }}</div>
76 collapsible ? 'panel-collapse',
77 collapsible ? 'collapse',
79 errors or collapsible and not collapsed ? 'in',
83 set description_classes = [
85 description and description.position == 'invisible' ? 'sr-only',
90 <div class="alert alert-danger" role="alert">
91 <strong>{{ errors }}</strong>
95 <div{{ body_attributes.addClass(body_classes) }}>
96 {% if description and description.position == 'before' %}
97 <p{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</p>
100 {% if description and description.position == 'after' or description.position == 'invisible' %}
101 <p{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</p>
110 set footer_classes = [
114 <div{{ footer_attributes.addClass(footer_classes) }}>{{ footer }}</div>