Skip to content

Commit

Permalink
Fixed bugs in the twig template logic
Browse files Browse the repository at this point in the history
  • Loading branch information
joelit committed Sep 21, 2023
1 parent d3e9387 commit cbae060
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/view/search-results.inc
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
{%- if propval.label %}
{%~ if propval.exvocab and propval.exvocab != propval.vocab ~%}{# if the property is located in a another vocabulary #}
<span class="versal value">{{ propval.label }}</span>
{%- else %}<span class="versal kolmas value">{{ propval.label(request.contentLang) }}</span>{% endif -%}
{%- if propval.lang and (propval.lang != request.lang) or explicit_langcodes %}<span class="versal"> ({{ propval.lang }})</span>{% endif -%}{%- if not loop.last %}<span class="versal">,</span>{% endif -%}
{%- else %}<span class="versal value">{{ propval.label(request.contentLang) }}</span>{% endif -%}
{%- if propval.lang and (propval.lang != request.lang) or explicit_langcodes %}<span class="versal"> ({{ propval.lang }})</span>{% endif -%}{%- if not loop.last %}<span class="versal">, </span>{% endif -%}
{% endif -%}
{%- else %} {# Literals (no URI), eg. alternative labels as properties #}
<span class="versal {%~ if propval.type == 'skos:altLabel' %}replaced {% endif ~%} value">{{ propval.label }}{%~ if not loop.last ~%},{%~ endif ~%}</span>
Expand Down Expand Up @@ -90,11 +90,11 @@
<span class="property-click skosmos-tooltip-wrapper skosmos-tooltip t-top" data-title="{{ property.type }}">
<i class="property-hover fa-solid fa-globe"></i>
</span>
<div class="property-values">
<span class="property-values">
{%~ for propval in property.values ~%} {# loop through ConceptMappingPropertyValue objects #}
{%~ if propval.exVocab ~%}<span class="redirected-vocab-id prefLabel">{{ propval.exVocab.shortName }}: </span>{%~ endif ~%}<span class="versal value">{{ propval.label(request.contentLang) }}</span>{%~ if propval.label(request.contentLang).lang != request.contentLang ~%}<span class="versal value"> ({{ propval.label(request.contentLang).lang }})</span>{%~ endif ~%}{%~ if loop.last == false ~%}<span class="versal">, </span>{%~ endif ~%}
{%~ endfor ~%}
</div>
</span>
</li>
{%~ endif ~%}
{%~ endfor ~%}
Expand All @@ -109,6 +109,7 @@
<span class="property-values">
{%~ for propval in property.values ~%} {# loop through ConceptPropertyValue objects #}
<span class="versal value">{{ propval.label }}</span>
{%- if loop.last == false %}<span class="versal">, </span>{% endif -%}
{%~ endfor ~%}
</span>
</li>
Expand Down

0 comments on commit cbae060

Please sign in to comment.