Skip to content

Commit 6415765

Browse files
authored
Merge pull request #298 from itk-dev/feature/LOOP-1220-document-collection-list
LOOP-1220: Fixed display of collection list
2 parents 7505515 + 3604e39 commit 6415765

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

web/profiles/custom/os2loop/themes/os2loop_theme/templates/content/node--os2loop-documents-document.html.twig

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@
101101
{% set tabs = tabs|merge([
102102
{'id': 'about-collection', 'name': 'Document collection'|t}
103103
]) %}
104+
{% elseif os2loop_documents_collections|default(false) %}
105+
{% set tabs = tabs|merge([
106+
{'id': 'about-collections', 'name': 'Document collections'|t}
107+
]) %}
104108
{% endif %}
105109
{% include '@os2loop_theme/navigation/content-tabs.html.twig' with {'tabs': tabs, 'id': 'document-tabs'} %}
106110
<div class="tab-content" id="document-tabs-content">
@@ -131,17 +135,18 @@
131135
<div class="h5">{{ 'Documents in collection'|t }}</div>
132136
{{ macros.table_of_contents(os2loop_documents_collection_tree, os2loop_documents_collection, node.id) }}
133137
</div>
134-
{% elseif os2loop_documents_collections|default(false) %}
135-
<div>
136-
<h2>{{ 'Document is part of these collections'|t }}</h2>
137-
<ol>
138-
{% for collection in os2loop_documents_collections %}
139-
<li><a href="{{ path('entity.node.canonical', {node: node.id, collection: collection.id, collection: collection.id}) }}">{{ collection.title.value }}</a></li>
140-
{% endfor %}
141-
</ol>
142-
</div>
143138
{% endif %}
144139
</div>
140+
{% elseif os2loop_documents_collections|default(false) %}
141+
<div class="tab-pane" id="about-collections" role="tabpanel" aria-labelledby="about-collections">
142+
{# We use div here to prevent it from appearing in TOC #}
143+
<div class="h5">{{ 'Document is part of these collections'|t }}</div>
144+
<ol>
145+
{% for collection in os2loop_documents_collections %}
146+
<li><a href="{{ path('entity.node.canonical', {node: node.id, collection: collection.id, collection: collection.id}) }}">{{ collection.title.value }}</a></li>
147+
{% endfor %}
148+
</ol>
149+
</div>
145150
{% endif %}
146151
</div>
147152
</article>

web/profiles/custom/os2loop/translations/translations.da.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29282,6 +29282,9 @@ msgstr "Dokumentsamling"
2928229282
msgid "Document collections"
2928329283
msgstr "Dokumentsamlinger"
2928429284

29285+
msgid "Document is part of these collections"
29286+
msgstr "Dokumentet indgår i disse dokumentsamlinger"
29287+
2928529288
msgid "Document metadata"
2928629289
msgstr "Om dokumentet"
2928729290

0 commit comments

Comments
 (0)