Show breadcrumb with structural links to parts list.

This commit is contained in:
Jan Böhmer 2019-09-08 16:29:56 +02:00
parent 429a4ebd17
commit 73f8ee36a5
2 changed files with 21 additions and 1 deletions

View file

@ -1,7 +1,11 @@
{% import "helper.twig" as helper %}
{{ helper.breadcrumb_entity_link(entity) }}
<div class="card mb-3"> <div class="card mb-3">
<div class="card-header"> <div class="card-header">
<a class="card-link" data-toggle="collapse" href="#entityInfo"> <a class="card-link" data-toggle="collapse" href="#entityInfo">
{{ header_label | trans }}: <b>{{ entity.fullPath }}</b> {{ header_label | trans }}: <b>{{ entity.name }}</b>
</a> </a>
</div> </div>
<div id="entityInfo" class="collapse"> <div id="entityInfo" class="collapse">

View file

@ -93,3 +93,19 @@
- -
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
{% macro breadcrumb_entity_link(entity, link_type = "list_parts") %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
{% for e in entity.pathArray %}
<li class="breadcrumb-item {% if loop.last %}active{% endif %}">
{% if link_type is not empty and not loop.last %}
<a href="{{ e | entityURL(link_type) }}">{{ e.name }}</a>
{% else %}
{{ e.name }}
{% endif %}
</li>
{% endfor %}
</ol>
</nav>
{% endmacro %}