mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Show breadcrumb with structural links to parts list.
This commit is contained in:
parent
429a4ebd17
commit
73f8ee36a5
2 changed files with 21 additions and 1 deletions
|
@ -1,7 +1,11 @@
|
|||
{% import "helper.twig" as helper %}
|
||||
|
||||
{{ helper.breadcrumb_entity_link(entity) }}
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<a class="card-link" data-toggle="collapse" href="#entityInfo">
|
||||
{{ header_label | trans }}: <b>{{ entity.fullPath }}</b>
|
||||
{{ header_label | trans }}: <b>{{ entity.name }}</b>
|
||||
</a>
|
||||
</div>
|
||||
<div id="entityInfo" class="collapse">
|
||||
|
|
|
@ -92,4 +92,20 @@
|
|||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
{% 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 %}
|
Loading…
Add table
Add a link
Reference in a new issue