Skip to content
Snippets Groups Projects
Commit 3a8642a8 authored by Matthias Lünemann's avatar Matthias Lünemann Committed by Sascha Eggenberger
Browse files

Issue #3271004: entity-add-list.html.twig creates broken html when bundles is empty

parent 8fd4e46c
No related branches found
No related tags found
1 merge request!113Issue #3271004: entity-add-list.html.twig creates broken html when bundles is empty
......@@ -21,35 +21,34 @@
]
%}
{% if bundles is not empty %}
<div class="panel">
{% if title %}
<h3 class="panel__title">{{ title }}</h3>
{% endif %}
<div class="panel">
{% if title %}
<h3 class="panel__title">{{ title }}</h3>
{% endif %}
<dl{{ attributes.addClass('admin-list', 'panel__content') }}>
{% for bundle in bundles %}
{#
Add 'admin-item__link' class to the link attributes.
This is needed for keeping the original attributes of the link's url.
#}
{% set bundle_attributes = bundle.add_link.url.getOption('attributes') ?: {} %}
{% set link_attributes = create_attribute(bundle_attributes).addClass('admin-item__link') %}
<div{{ create_attribute({ class: item_classes }) }}>
<a class="admin-item__link" href="{{ bundle.add_link.url }}"></a>
<dt class="admin-item__title">
{{ bundle.add_link.text }}
</dt>
{# Don't print empty description wrapper if there is no description #}
{% if bundle.description %}
<dd class="admin-item__description">{{ bundle.description }}</dd>
{% endif %}
</div>
{% endfor %}
</dl>
</div>
<dl{{ attributes.addClass('admin-list', 'panel__content') }}>
{% for bundle in bundles %}
{#
Add 'admin-item__link' class to the link attributes.
This is needed for keeping the original attributes of the link's url.
#}
{% set bundle_attributes = bundle.add_link.url.getOption('attributes') ?: {} %}
{% set link_attributes = create_attribute(bundle_attributes).addClass('admin-item__link') %}
<div{{ create_attribute({ class: item_classes }) }}>
<a class="admin-item__link" href="{{ bundle.add_link.url }}"></a>
<dt class="admin-item__title">
{{ bundle.add_link.text }}
</dt>
{# Don't print empty description wrapper if there is no description #}
{% if bundle.description %}
<dd class="admin-item__description">{{ bundle.description }}</dd>
{% endif %}
</div>
{% endfor %}
</dl>
</div>
{% elseif add_bundle_message is not empty %}
<p>
{{ add_bundle_message }}
</p>
</div>
{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment