From a48342bc8b8839bc53dd55a8b9c2ba8d4cc9e4c0 Mon Sep 17 00:00:00 2001 From: Osma Suominen Date: Thu, 9 Apr 2020 14:24:23 +0300 Subject: [PATCH] Avoid displaying empty type field in search result list. Fixes #942 --- view/search-result.twig | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/view/search-result.twig b/view/search-result.twig index b8cdb0517..45d62ede1 100644 --- a/view/search-result.twig +++ b/view/search-result.twig @@ -107,32 +107,20 @@ {% endfor %} {% endif %} {% endif %} -
- - - -
- {% for property in conceptProperties %} {# loop through ConceptProperty objects #} - {% if property.getSubPropertyOf != 'skos:hiddenLabel' %} - {% if request.vocab.config.hasMultiLingualProperty(property.type) %} - {% set prevlang = '' %}{# Only displaying the language when it appears for the very first time #} - {% for language,labels in concept.allLabels(property.type) %} - {% for value in labels %} -
{{ value.label }}{% if prevlang != language %} {{ language }}{% endif %}
- {% set prevlang = language %} - {% endfor %} - {% endfor %} - {% else %} - {% for propval in property.values %} {# loop through ConceptPropertyValue objects #} - {% if property.type == 'rdf:type' %} - {{ propval.label|trans }} - {% endif %} - {% endfor %} - {% endif %} - {% endif %} - {% endfor %} -
-
+ {% for property in conceptProperties %} {# loop through ConceptProperty objects #} + {% if property.type == 'rdf:type' %} +
+ + + +
+ {% for propval in property.values %} {# loop through ConceptPropertyValue objects #} + {{ propval.label|trans }} + {% endfor %} +
+
+ {% endif %} + {% endfor %} {% if concept.uri %}
{{ concept.uri }}
{% endif %}