From a74015a1366f56bb72e9a0341c8ffabbe90c802f Mon Sep 17 00:00:00 2001 From: Tero Elonen Date: Tue, 27 Aug 2024 15:35:49 +0300 Subject: [PATCH] UHF-10191: Fix broken layout on fallback view from district and project search, fix translations to apply on District word --- .../content/node--district--teaser.html.twig | 84 ++++++++----------- .../custom/hdbt_subtheme/translations/fi.po | 4 +- .../custom/hdbt_subtheme/translations/sv.po | 4 +- 3 files changed, 43 insertions(+), 49 deletions(-) diff --git a/public/themes/custom/hdbt_subtheme/templates/content/node--district--teaser.html.twig b/public/themes/custom/hdbt_subtheme/templates/content/node--district--teaser.html.twig index 4dce93b5f..aa68b6a9d 100644 --- a/public/themes/custom/hdbt_subtheme/templates/content/node--district--teaser.html.twig +++ b/public/themes/custom/hdbt_subtheme/templates/content/node--district--teaser.html.twig @@ -5,50 +5,40 @@ ] %} -{% set link_title %} - {{ title_prefix }} -

- {{ label }} -

- {{ title_suffix }} -{% endset %} - -{% set link_attributes = { - 'class': [ - 'district-teaser__link', - ], - 'rel': 'bookmark', -} %} - - -
- {% if content.field_district_image.0 %} - {{ content.field_district_image }} - {% else %} - {% include '@hdbt/media/image--card.html.twig' with {content: '' } %} - {% endif %} -
-
- {% set tag_content %} - {{ 'District'|t }} - {% endset %} - {% embed '@hdbt/misc/tag-list.twig' with { tag_container_class: ' content-tags--card' } %} - {% block content %} - {% include '@hdbt/misc/tag.twig' with { - color: 'coat-of-arms', - tag: tag_content - }%} - {% endblock content %} - {% endembed %} - {{ link(link_title, node_url, link_attributes) }} - {% if content.field_subdistricts.0 %} - {% include '@hdbt/misc/metadata-item.twig' with { - item_icon: 'location', - item_label: 'Districts'|t, - item_content: content.field_subdistricts, - }%} - {% endif %} - - {% include "@hdbt/misc/icon.twig" with {icon: 'arrow-right' } only %} -
- +{% if content.field_subdistricts.0 %} + {% set subdistricts = content.field_subdistricts %} + {% embed '@hdbt/component/card.twig' with { + card_modifier_class: classes|join(' '), + card_image: content.field_district_image, + card_title: label, + card_url: node_url, + card_metas: [ + { + icon: 'location', + label: 'Districts'|t, + content: subdistricts + }, + ], + card_tags: [ + { + tag: 'District'|t, + color: 'coat-of-arms', + }, + ], + } %} + {% endembed %} +{% else %} + {% embed '@hdbt/component/card.twig' with { + card_modifier_class: classes|join(' '), + card_image: content.field_district_image, + card_title: label, + card_url: node_url, + card_tags: [ + { + tag: 'District'|t, + color: 'coat-of-arms', + }, + ], + } %} + {% endembed %} +{% endif %} diff --git a/public/themes/custom/hdbt_subtheme/translations/fi.po b/public/themes/custom/hdbt_subtheme/translations/fi.po index db1eab2e3..92632dcec 100644 --- a/public/themes/custom/hdbt_subtheme/translations/fi.po +++ b/public/themes/custom/hdbt_subtheme/translations/fi.po @@ -1,4 +1,6 @@ -# Finnish translations +msgid "" +msgstr "" + msgid "District" msgstr "Alue" diff --git a/public/themes/custom/hdbt_subtheme/translations/sv.po b/public/themes/custom/hdbt_subtheme/translations/sv.po index 2a5631218..e79f0dd8b 100644 --- a/public/themes/custom/hdbt_subtheme/translations/sv.po +++ b/public/themes/custom/hdbt_subtheme/translations/sv.po @@ -1,4 +1,6 @@ -# Swedish translations +msgid "" +msgstr "" + msgid "District" msgstr "Område"