From 6cdcbb4cddc8716bcad129d734ff83bc7fab7b8d Mon Sep 17 00:00:00 2001 From: Romain Emery Date: Thu, 13 Jun 2024 10:19:31 +0200 Subject: [PATCH] feat(gallery): design update - FRONT-4387 (#3390) --- .../__snapshots__/gallery.test.js.snap | 1160 +++++++++-------- .../components/gallery/gallery-item.html.twig | 10 +- .../gallery/gallery-overlay.html.twig | 173 +-- .../twig/components/gallery/gallery.html.twig | 3 +- .../vanilla/components/button/button.scss | 5 +- .../components/gallery/gallery-print.scss | 5 + .../vanilla/components/gallery/gallery.js | 13 - .../vanilla/components/gallery/gallery.scss | 127 +- .../vanilla/components/gallery/package.json | 1 + src/themes/ec/theme.scss | 3 + src/themes/ec/variables/_button.scss | 1 + src/themes/ec/variables/_gallery.scss | 4 +- src/themes/eu/theme.scss | 15 +- src/themes/eu/variables/_button.scss | 1 + src/themes/eu/variables/_gallery.scss | 2 - 15 files changed, 807 insertions(+), 716 deletions(-) diff --git a/src/implementations/twig/components/gallery/__snapshots__/gallery.test.js.snap b/src/implementations/twig/components/gallery/__snapshots__/gallery.test.js.snap index 3650c8746f1..2f911c51b74 100644 --- a/src/implementations/twig/components/gallery/__snapshots__/gallery.test.js.snap +++ b/src/implementations/twig/components/gallery/__snapshots__/gallery.test.js.snap @@ -40,15 +40,17 @@ exports[`Gallery Default renders correctly 1`] = ` > EU in brief - The EU in brief, institutions and bodies, countries, symbols, history, facts and figures + + The EU in brief, institutions and bodies, countries, symbols, history, facts and figures + Copyright, Author, Licence for image 1 @@ -97,15 +99,17 @@ exports[`Gallery Default renders correctly 1`] = ` > New digital strategy - Digital technologies have greatly changed our daily life. Therefore, Europe wants to make sure, that the digital transformation works for all its citizens. + + Digital technologies have greatly changed our daily life. Therefore, Europe wants to make sure, that the digital transformation works for all its citizens. + Copyright, Author, Licence for embedded media @@ -141,15 +145,17 @@ exports[`Gallery Default renders correctly 1`] = ` > Agriculture and culture - Information on agriculture, business, culture, health, etc. + + Information on agriculture, business, culture, health, etc. + Copyright, Author, Licence for image 2 @@ -199,15 +205,17 @@ exports[`Gallery Default renders correctly 1`] = ` > In the EU - Living, working, travelling in the EU + + Living, working, travelling in the EU + Copyright, Author, Licence for image 3 @@ -257,15 +265,17 @@ exports[`Gallery Default renders correctly 1`] = ` > Taxes and business - Information on taxes, customs, importing and exporting goods, financial support for businesses + + Information on taxes, customs, importing and exporting goods, financial support for businesses + Copyright, Author, Licence for image 4 @@ -330,15 +340,17 @@ exports[`Gallery Default renders correctly 1`] = ` > EU law - EU law + + EU law + Copyright, Author, Licence for image 5 @@ -388,15 +400,17 @@ exports[`Gallery Default renders correctly 1`] = ` > Lorem ipsum - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a diam dignissim, suscipit augue in, fermentum nibh. Donec vestibulum justo cursus quam luctus, quis maximus nisi feugiat. Nullam lobortis tellus libero, vitae lobortis nisl suscipit ac. + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a diam dignissim, suscipit augue in, fermentum nibh. Donec vestibulum justo cursus quam luctus, quis maximus nisi feugiat. Nullam lobortis tellus libero, vitae lobortis nisl suscipit ac. + Copyright, Author, Licence for image 6 @@ -432,15 +446,17 @@ exports[`Gallery Default renders correctly 1`] = ` > Teaching material - Teaching material about the EU, including books and maps + + Teaching material about the EU, including books and maps + Copyright, Author, Licence for image 7 @@ -489,15 +505,17 @@ exports[`Gallery Default renders correctly 1`] = ` > Climate change - Climate change and protect nature + + Climate change and protect nature + Copyright, Author, Licence for embedded media @@ -533,15 +551,17 @@ exports[`Gallery Default renders correctly 1`] = ` > About the EU - About the EU + + About the EU + Copyright, Author, Licence for image 9 @@ -577,15 +597,17 @@ exports[`Gallery Default renders correctly 1`] = ` > EU by topic - EU by topic + + EU by topic + Copyright, Author, Licence for image 10 @@ -602,6 +624,7 @@ exports[`Gallery Default renders correctly 1`] = ` > - - - - @@ -879,15 +905,17 @@ exports[`Gallery Default renders correctly with extra attributes 1`] = ` > EU in brief - The EU in brief, institutions and bodies, countries, symbols, history, facts and figures + + The EU in brief, institutions and bodies, countries, symbols, history, facts and figures + Copyright, Author, Licence for image 1 @@ -936,15 +964,17 @@ exports[`Gallery Default renders correctly with extra attributes 1`] = ` > New digital strategy - Digital technologies have greatly changed our daily life. Therefore, Europe wants to make sure, that the digital transformation works for all its citizens. + + Digital technologies have greatly changed our daily life. Therefore, Europe wants to make sure, that the digital transformation works for all its citizens. + Copyright, Author, Licence for embedded media @@ -980,15 +1010,17 @@ exports[`Gallery Default renders correctly with extra attributes 1`] = ` > Agriculture and culture - Information on agriculture, business, culture, health, etc. + + Information on agriculture, business, culture, health, etc. + Copyright, Author, Licence for image 2 @@ -1038,15 +1070,17 @@ exports[`Gallery Default renders correctly with extra attributes 1`] = ` > In the EU - Living, working, travelling in the EU + + Living, working, travelling in the EU + Copyright, Author, Licence for image 3 @@ -1096,15 +1130,17 @@ exports[`Gallery Default renders correctly with extra attributes 1`] = ` > Taxes and business - Information on taxes, customs, importing and exporting goods, financial support for businesses + + Information on taxes, customs, importing and exporting goods, financial support for businesses + Copyright, Author, Licence for image 4 @@ -1169,15 +1205,17 @@ exports[`Gallery Default renders correctly with extra attributes 1`] = ` > EU law - EU law + + EU law + Copyright, Author, Licence for image 5 @@ -1227,15 +1265,17 @@ exports[`Gallery Default renders correctly with extra attributes 1`] = ` > Lorem ipsum - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a diam dignissim, suscipit augue in, fermentum nibh. Donec vestibulum justo cursus quam luctus, quis maximus nisi feugiat. Nullam lobortis tellus libero, vitae lobortis nisl suscipit ac. + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a diam dignissim, suscipit augue in, fermentum nibh. Donec vestibulum justo cursus quam luctus, quis maximus nisi feugiat. Nullam lobortis tellus libero, vitae lobortis nisl suscipit ac. + Copyright, Author, Licence for image 6 @@ -1271,15 +1311,17 @@ exports[`Gallery Default renders correctly with extra attributes 1`] = ` > Teaching material - Teaching material about the EU, including books and maps + + Teaching material about the EU, including books and maps + Copyright, Author, Licence for image 7 @@ -1328,15 +1370,17 @@ exports[`Gallery Default renders correctly with extra attributes 1`] = ` > Climate change - Climate change and protect nature + + Climate change and protect nature + Copyright, Author, Licence for embedded media @@ -1372,15 +1416,17 @@ exports[`Gallery Default renders correctly with extra attributes 1`] = ` > About the EU - About the EU + + About the EU + Copyright, Author, Licence for image 9 @@ -1416,15 +1462,17 @@ exports[`Gallery Default renders correctly with extra attributes 1`] = ` > EU by topic - EU by topic + + EU by topic + Copyright, Author, Licence for image 10 @@ -1441,6 +1489,7 @@ exports[`Gallery Default renders correctly with extra attributes 1`] = ` > - - - - @@ -1716,15 +1768,17 @@ exports[`Gallery Default renders correctly with extra class names 1`] = ` > EU in brief - The EU in brief, institutions and bodies, countries, symbols, history, facts and figures + + The EU in brief, institutions and bodies, countries, symbols, history, facts and figures + Copyright, Author, Licence for image 1 @@ -1773,15 +1827,17 @@ exports[`Gallery Default renders correctly with extra class names 1`] = ` > New digital strategy - Digital technologies have greatly changed our daily life. Therefore, Europe wants to make sure, that the digital transformation works for all its citizens. + + Digital technologies have greatly changed our daily life. Therefore, Europe wants to make sure, that the digital transformation works for all its citizens. + Copyright, Author, Licence for embedded media @@ -1817,15 +1873,17 @@ exports[`Gallery Default renders correctly with extra class names 1`] = ` > Agriculture and culture - Information on agriculture, business, culture, health, etc. + + Information on agriculture, business, culture, health, etc. + Copyright, Author, Licence for image 2 @@ -1875,15 +1933,17 @@ exports[`Gallery Default renders correctly with extra class names 1`] = ` > In the EU - Living, working, travelling in the EU + + Living, working, travelling in the EU + Copyright, Author, Licence for image 3 @@ -1933,15 +1993,17 @@ exports[`Gallery Default renders correctly with extra class names 1`] = ` > Taxes and business - Information on taxes, customs, importing and exporting goods, financial support for businesses + + Information on taxes, customs, importing and exporting goods, financial support for businesses + Copyright, Author, Licence for image 4 @@ -2006,15 +2068,17 @@ exports[`Gallery Default renders correctly with extra class names 1`] = ` > EU law - EU law + + EU law + Copyright, Author, Licence for image 5 @@ -2064,15 +2128,17 @@ exports[`Gallery Default renders correctly with extra class names 1`] = ` > Lorem ipsum - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a diam dignissim, suscipit augue in, fermentum nibh. Donec vestibulum justo cursus quam luctus, quis maximus nisi feugiat. Nullam lobortis tellus libero, vitae lobortis nisl suscipit ac. + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a diam dignissim, suscipit augue in, fermentum nibh. Donec vestibulum justo cursus quam luctus, quis maximus nisi feugiat. Nullam lobortis tellus libero, vitae lobortis nisl suscipit ac. + Copyright, Author, Licence for image 6 @@ -2108,15 +2174,17 @@ exports[`Gallery Default renders correctly with extra class names 1`] = ` > Teaching material - Teaching material about the EU, including books and maps + + Teaching material about the EU, including books and maps + Copyright, Author, Licence for image 7 @@ -2165,15 +2233,17 @@ exports[`Gallery Default renders correctly with extra class names 1`] = ` > Climate change - Climate change and protect nature + + Climate change and protect nature + Copyright, Author, Licence for embedded media @@ -2209,15 +2279,17 @@ exports[`Gallery Default renders correctly with extra class names 1`] = ` > About the EU - About the EU + + About the EU + Copyright, Author, Licence for image 9 @@ -2253,15 +2325,17 @@ exports[`Gallery Default renders correctly with extra class names 1`] = ` > EU by topic - EU by topic + + EU by topic + Copyright, Author, Licence for image 10 @@ -2278,6 +2352,7 @@ exports[`Gallery Default renders correctly with extra class names 1`] = ` > - - - - @@ -2553,15 +2631,17 @@ exports[`Gallery Default renders correctly with old data 1`] = ` > EU in brief - The EU in brief, institutions and bodies, countries, symbols, history, facts and figures + + The EU in brief, institutions and bodies, countries, symbols, history, facts and figures + Copyright, Author, Licence for image 1 @@ -2610,15 +2690,17 @@ exports[`Gallery Default renders correctly with old data 1`] = ` > New digital strategy - Digital technologies have greatly changed our daily life. Therefore, Europe wants to make sure, that the digital transformation works for all its citizens. + + Digital technologies have greatly changed our daily life. Therefore, Europe wants to make sure, that the digital transformation works for all its citizens. + Copyright, Author, Licence for embedded media @@ -2654,15 +2736,17 @@ exports[`Gallery Default renders correctly with old data 1`] = ` > Agriculture and culture - Information on agriculture, business, culture, health, etc. + + Information on agriculture, business, culture, health, etc. + Copyright, Author, Licence for image 2 @@ -2712,15 +2796,17 @@ exports[`Gallery Default renders correctly with old data 1`] = ` > In the EU - Living, working, travelling in the EU + + Living, working, travelling in the EU + Copyright, Author, Licence for image 3 @@ -2770,15 +2856,17 @@ exports[`Gallery Default renders correctly with old data 1`] = ` > Taxes and business - Information on taxes, customs, importing and exporting goods, financial support for businesses + + Information on taxes, customs, importing and exporting goods, financial support for businesses + Copyright, Author, Licence for image 4 @@ -2843,15 +2931,17 @@ exports[`Gallery Default renders correctly with old data 1`] = ` > EU law - EU law + + EU law + Copyright, Author, Licence for image 5 @@ -2901,15 +2991,17 @@ exports[`Gallery Default renders correctly with old data 1`] = ` > Lorem ipsum - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a diam dignissim, suscipit augue in, fermentum nibh. Donec vestibulum justo cursus quam luctus, quis maximus nisi feugiat. Nullam lobortis tellus libero, vitae lobortis nisl suscipit ac. + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a diam dignissim, suscipit augue in, fermentum nibh. Donec vestibulum justo cursus quam luctus, quis maximus nisi feugiat. Nullam lobortis tellus libero, vitae lobortis nisl suscipit ac. + Copyright, Author, Licence for image 6 @@ -2945,15 +3037,17 @@ exports[`Gallery Default renders correctly with old data 1`] = ` > Teaching material - Teaching material about the EU, including books and maps + + Teaching material about the EU, including books and maps + Copyright, Author, Licence for image 7 @@ -3002,15 +3096,17 @@ exports[`Gallery Default renders correctly with old data 1`] = ` > Climate change - Climate change and protect nature + + Climate change and protect nature + Copyright, Author, Licence for embedded media @@ -3046,15 +3142,17 @@ exports[`Gallery Default renders correctly with old data 1`] = ` > About the EU - About the EU + + About the EU + Copyright, Author, Licence for image 9 @@ -3090,15 +3188,17 @@ exports[`Gallery Default renders correctly with old data 1`] = ` > EU by topic - EU by topic + + EU by topic + Copyright, Author, Licence for image 10 @@ -3115,6 +3215,7 @@ exports[`Gallery Default renders correctly with old data 1`] = ` > - - - - diff --git a/src/implementations/twig/components/gallery/gallery-item.html.twig b/src/implementations/twig/components/gallery/gallery-item.html.twig index 52e908c4f89..4833b84c5f1 100644 --- a/src/implementations/twig/components/gallery/gallery-item.html.twig +++ b/src/implementations/twig/components/gallery/gallery-item.html.twig @@ -118,13 +118,17 @@ data-ecl-gallery-description > {%- if _item.title is defined and _item.title is not empty -%} - + {{- _item.title -}} {%- endif -%} - {{- _item.description -}} + {%- if _item.description is defined and _item.description is not empty -%} + + {{- _item.description -}} + + {%- endif -%} {%- if _item.meta is defined and _item.meta is not empty -%} - + {{- _item.meta -}} {%- endif -%} diff --git a/src/implementations/twig/components/gallery/gallery-overlay.html.twig b/src/implementations/twig/components/gallery/gallery-overlay.html.twig index 2fe41b65a4b..cb452bec2e9 100644 --- a/src/implementations/twig/components/gallery/gallery-overlay.html.twig +++ b/src/implementations/twig/components/gallery/gallery-overlay.html.twig @@ -62,88 +62,94 @@
-
diff --git a/src/implementations/twig/components/gallery/gallery.html.twig b/src/implementations/twig/components/gallery/gallery.html.twig index 9cf176fbec1..3a1ec8d0be8 100644 --- a/src/implementations/twig/components/gallery/gallery.html.twig +++ b/src/implementations/twig/components/gallery/gallery.html.twig @@ -116,7 +116,7 @@