From cbae0608c1c9e1a71df938d65ed29f715c733e21 Mon Sep 17 00:00:00 2001 From: Joeli Takala Date: Thu, 21 Sep 2023 20:06:26 +0300 Subject: [PATCH] Fixed bugs in the twig template logic --- src/view/search-results.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/view/search-results.inc b/src/view/search-results.inc index 9e099dd3c..c7bd962b0 100644 --- a/src/view/search-results.inc +++ b/src/view/search-results.inc @@ -57,8 +57,8 @@ {%- if propval.label %} {%~ if propval.exvocab and propval.exvocab != propval.vocab ~%}{# if the property is located in a another vocabulary #} {{ propval.label }} - {%- else %}{{ propval.label(request.contentLang) }}{% endif -%} - {%- if propval.lang and (propval.lang != request.lang) or explicit_langcodes %} ({{ propval.lang }}){% endif -%}{%- if not loop.last %},{% endif -%} + {%- else %}{{ propval.label(request.contentLang) }}{% endif -%} + {%- if propval.lang and (propval.lang != request.lang) or explicit_langcodes %} ({{ propval.lang }}){% endif -%}{%- if not loop.last %}, {% endif -%} {% endif -%} {%- else %} {# Literals (no URI), eg. alternative labels as properties #} {{ propval.label }}{%~ if not loop.last ~%},{%~ endif ~%} @@ -90,11 +90,11 @@ -
+ {%~ for propval in property.values ~%} {# loop through ConceptMappingPropertyValue objects #} {%~ if propval.exVocab ~%}{{ propval.exVocab.shortName }}: {%~ endif ~%}{{ propval.label(request.contentLang) }}{%~ if propval.label(request.contentLang).lang != request.contentLang ~%} ({{ propval.label(request.contentLang).lang }}){%~ endif ~%}{%~ if loop.last == false ~%}, {%~ endif ~%} {%~ endfor ~%} -
+ {%~ endif ~%} {%~ endfor ~%} @@ -109,6 +109,7 @@ {%~ for propval in property.values ~%} {# loop through ConceptPropertyValue objects #} {{ propval.label }} + {%- if loop.last == false %}, {% endif -%} {%~ endfor ~%}