From 15e0e418f216e7ef0fe5985408ad8ac7cd1d22f3 Mon Sep 17 00:00:00 2001 From: Aline Date: Fri, 24 Nov 2023 11:37:33 +0100 Subject: [PATCH 1/3] Add popover caption to fullwidth teaser --- .../fullwidth-teaser/fullwidth-teaser-horizontal.twig | 7 ++++++- .../organisms/fullwidth-teaser/fullwidth-teaser.scss | 8 +++++--- .../organisms/fullwidth-teaser/fullwidth-teaser.twig | 7 ++++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser-horizontal.twig b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser-horizontal.twig index 94639008..ddf2ef1b 100644 --- a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser-horizontal.twig +++ b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser-horizontal.twig @@ -2,7 +2,12 @@
- {% include '@atoms/picture/picture-fullwidth-teaser.twig' %} +
+ {% include '@atoms/picture/picture-fullwidth-teaser.twig' %} +
+ {% include '@atoms/popover/popover.twig' %} +
+
diff --git a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.scss b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.scss index f07fb702..b92d2cad 100644 --- a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.scss +++ b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.scss @@ -27,7 +27,9 @@ width: 100%; height: auto; } - figure{ + figure, + figure picture, + figure img { margin-bottom: 0; } @@ -184,11 +186,11 @@ border-top-color: color.adjust($red, $lightness: -15%); } } - + &:active:after { border-top-color: color.adjust($red-dark, $lightness: -10%); } - + &:focus { outline: 0 !important; } diff --git a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.twig b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.twig index 5f23160a..6b5d53ba 100644 --- a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.twig +++ b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.twig @@ -1,6 +1,11 @@
- {% include '@atoms/picture/picture-fullwidth-teaser.twig' %} +
+ {% include '@atoms/picture/picture-fullwidth-teaser.twig' %} +
+ {% include '@atoms/popover/popover.twig' %} +
+
From f7003aa19eba47fd34629fea2c8f669c560f2782 Mon Sep 17 00:00:00 2001 From: Aline Date: Mon, 27 Nov 2023 14:29:38 +0100 Subject: [PATCH 2/3] Fix height --- .../organisms/fullwidth-teaser/fullwidth-teaser.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.scss b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.scss index b92d2cad..2906a461 100644 --- a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.scss +++ b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.scss @@ -33,6 +33,11 @@ margin-bottom: 0; } + figure picture, + figure img { + height: 100%; + } + picture, figure, .fullwidth-teaser-text { From 1da0d5021f882f0afa621cd665eac0df3e4810fd Mon Sep 17 00:00:00 2001 From: Aline Date: Wed, 29 Nov 2023 14:45:25 +0100 Subject: [PATCH 3/3] Create component variants Use variants for fullwidth teaser and headlines with image legend. --- .../fullwidth-teaser-horizontal.twig | 4 ++ .../fullwidth-teaser-legend.twig | 38 ++++++++++++++++ .../fullwidth-teaser/fullwidth-teaser.twig | 7 +-- .../fullwidth-teaser/fullwidth-teaser.yml | 6 +++ .../organisms/headlines/headlines-legend.twig | 44 +++++++++++++++++++ .../organisms/headlines/headlines.yml | 3 ++ 6 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 assets/components/organisms/fullwidth-teaser/fullwidth-teaser-legend.twig create mode 100644 assets/components/organisms/headlines/headlines-legend.twig diff --git a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser-horizontal.twig b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser-horizontal.twig index ddf2ef1b..8b9c68bd 100644 --- a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser-horizontal.twig +++ b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser-horizontal.twig @@ -2,12 +2,16 @@
+ {% if has_image_legend|default(false) %}
{% include '@atoms/picture/picture-fullwidth-teaser.twig' %}
{% include '@atoms/popover/popover.twig' %}
+ {% else %} + {% include '@atoms/picture/picture-fullwidth-teaser.twig' %} + {% endif %}
diff --git a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser-legend.twig b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser-legend.twig new file mode 100644 index 00000000..6b5d53ba --- /dev/null +++ b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser-legend.twig @@ -0,0 +1,38 @@ +
+ +
+ {% include '@atoms/picture/picture-fullwidth-teaser.twig' %} +
+ {% include '@atoms/popover/popover.twig' %} +
+
+ +
+ +
+
+

+ {% if not title %}{% set title %}Évaluer la durabilité dans le domaine spatial{% endset %}{% endif %} + {{title}} +

+
+ + En savoir plus + {% include '@atoms/icon/icon.twig' with {icon: 'icon-chevron-right'} %} + +
+ +
+

+ {% if not content %} + {% set content %}Le nouveau Space Sustainability Rating accueilli par eSpace, le centre spatial de l’EPFL, encourage le secteur de l’espace à concevoir et à mettre en œuvre des missions spatiales durables et responsables — montrant ainsi la voie pour assurer à long terme une approche durable de l’environnement spatial.{% endset %} + {% endif %} + {{content}} +

+
+ + +
+
diff --git a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.twig b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.twig index 6b5d53ba..5f23160a 100644 --- a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.twig +++ b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.twig @@ -1,11 +1,6 @@
-
- {% include '@atoms/picture/picture-fullwidth-teaser.twig' %} -
- {% include '@atoms/popover/popover.twig' %} -
-
+ {% include '@atoms/picture/picture-fullwidth-teaser.twig' %}
diff --git a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.yml b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.yml index 655131d0..a155f769 100644 --- a/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.yml +++ b/assets/components/organisms/fullwidth-teaser/fullwidth-teaser.yml @@ -1,6 +1,12 @@ title: Fullwidth teaser name: fullwidth-teaser variants: + - name: legend + title: Fullwidth teaser with image legend + notes: | + The [popover](#/atoms/popover) component can be used on any Fullwidth teaser variant in order to add a legend to the image. + + The markup structure is similar to the [cover](#/molecules/cover) component. - name: horizontal title: Horizontal - name: left diff --git a/assets/components/organisms/headlines/headlines-legend.twig b/assets/components/organisms/headlines/headlines-legend.twig new file mode 100644 index 00000000..80ad89ae --- /dev/null +++ b/assets/components/organisms/headlines/headlines-legend.twig @@ -0,0 +1,44 @@ +{% macro card_link(card) %} + +
+

{{ card.title }}

+
+ {% if card.date %} + + + + {% endif %} + {% for item in card.info %} + {{ item }} + {% endfor %} +
+

{{ card.content }}

+
+
+{% endmacro %} +{% import _self as macros %} + +{% set bottomlink = bottomlink|default(true) %} + +{# The intro fullwidth teaser #} +{% include '@organisms/fullwidth-teaser/fullwidth-teaser-horizontal.twig' with { has_image_legend: true } %} + +{# First teasers #} +
+
+
+
+ {% for card in homepage.section_one.cards %} +
+ {{ macros.card_link(card) }} +
+ {% endfor %} +
+ {% if bottomlink %} +

+ {{ homepage.section_one.readmore }} +

+ {% endif %} +
+
+
diff --git a/assets/components/organisms/headlines/headlines.yml b/assets/components/organisms/headlines/headlines.yml index 8aae5de2..a920f0d6 100644 --- a/assets/components/organisms/headlines/headlines.yml +++ b/assets/components/organisms/headlines/headlines.yml @@ -1,2 +1,5 @@ title: Headlines name: headlines +variants: +- name: legend + title: Headlines with image legend