From 80d1284484d598284e526caf5514325df64f319c Mon Sep 17 00:00:00 2001 From: Valentin Le Moign Date: Tue, 10 Jun 2025 18:19:59 +0200 Subject: [PATCH] display multiple links on news pages --- web/profiles/drupal-starterkit-profile | 2 +- web/themes/erabletheme/css/styles.css | 16 ++++++++-------- web/themes/erabletheme/js/erabletheme.js | 10 ++++++---- .../erabletheme/scss/partials/_articles.scss | 2 +- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/web/profiles/drupal-starterkit-profile b/web/profiles/drupal-starterkit-profile index 0072fa8..6122ad5 160000 --- a/web/profiles/drupal-starterkit-profile +++ b/web/profiles/drupal-starterkit-profile @@ -1 +1 @@ -Subproject commit 0072fa85fb15b168503b63af2b7df56f2a5e2b67 +Subproject commit 6122ad5f5b1519bcca5014ea331ae61415480ea3 diff --git a/web/themes/erabletheme/css/styles.css b/web/themes/erabletheme/css/styles.css index 19408c1..ab2acf2 100644 --- a/web/themes/erabletheme/css/styles.css +++ b/web/themes/erabletheme/css/styles.css @@ -3625,12 +3625,12 @@ aside.layout-sidebar-first:has(#block-erabletheme-views-block-projets-block-1) > font-size: 1.2rem; } } -.actu_full .liens_fixed > div > div:nth-of-type(2), .actu_full .file_fixed > div > div > div { +.actu_full .liens_fixed > div > div:nth-of-type(2) > div, .actu_full .file_fixed > div > div > div { padding: 0 1.5vw; text-align: right; margin: 2rem 0; } -.actu_full .liens_fixed > div > div:nth-of-type(2) a, .actu_full .file_fixed > div > div > div a { +.actu_full .liens_fixed > div > div:nth-of-type(2) > div a, .actu_full .file_fixed > div > div > div a { text-align: center; color: black; font-family: "Marianne", sans-serif; @@ -3642,27 +3642,27 @@ aside.layout-sidebar-first:has(#block-erabletheme-views-block-projets-block-1) > transition: background-color 0.3s ease; text-wrap: nowrap !important; } -.actu_full .liens_fixed > div > div:nth-of-type(2) a svg, .actu_full .file_fixed > div > div > div a svg { +.actu_full .liens_fixed > div > div:nth-of-type(2) > div a svg, .actu_full .file_fixed > div > div > div a svg { display: none; } -.actu_full .liens_fixed > div > div:nth-of-type(2) a:hover, .actu_full .file_fixed > div > div > div a:hover { +.actu_full .liens_fixed > div > div:nth-of-type(2) > div a:hover, .actu_full .file_fixed > div > div > div a:hover { background-color: #00ff80; } -.actu_full .liens_fixed > div > div:nth-of-type(2) a, .actu_full .file_fixed > div > div > div a { +.actu_full .liens_fixed > div > div:nth-of-type(2) > div a, .actu_full .file_fixed > div > div > div a { display: inline-block; } @media (min-width: 1080px) { - .actu_full .liens_fixed > div > div:nth-of-type(2), .actu_full .file_fixed > div > div > div { + .actu_full .liens_fixed > div > div:nth-of-type(2) > div, .actu_full .file_fixed > div > div > div { margin-bottom: 0 !important; margin: 0; position: fixed; left: 75vw; bottom: 10vh; } - .actu_full .liens_fixed > div > div:nth-of-type(2) > div, .actu_full .file_fixed > div > div > div > div { + .actu_full .liens_fixed > div > div:nth-of-type(2) > div > div, .actu_full .file_fixed > div > div > div > div { height: 3vh; } - .actu_full .liens_fixed > div > div:nth-of-type(2) a, .actu_full .file_fixed > div > div > div a { + .actu_full .liens_fixed > div > div:nth-of-type(2) > div a, .actu_full .file_fixed > div > div > div a { max-width: 19vw; } } diff --git a/web/themes/erabletheme/js/erabletheme.js b/web/themes/erabletheme/js/erabletheme.js index bd8432c..f4c05b6 100644 --- a/web/themes/erabletheme/js/erabletheme.js +++ b/web/themes/erabletheme/js/erabletheme.js @@ -138,7 +138,7 @@ // let fluoButtons; if (document.querySelector('.actu_full')) { - fluoButtons = document.querySelectorAll('.liens_fixed > div > div:nth-of-type(2):not(.visually-hidden), .file_fixed > div > .visually-hidden + div > div'); + fluoButtons = document.querySelectorAll('.liens_fixed > div > div:nth-of-type(2):not(.visually-hidden) > div, .file_fixed > div > .visually-hidden + div > div'); } else if (document.querySelector('.offre-content')) { fluoButtons = document.querySelectorAll('.liens_fixed > div, .file_fixed > div > div'); } else if (document.querySelector('.projets')) { @@ -365,7 +365,7 @@ for (let item of asideProjectMenu.children) { const itemTitle = item.innerText; const contentPage = document.querySelector('.projet_full'); - const contentPageTitle = contentPage.querySelector('h2').innerText; + const contentPageTitle = contentPage.querySelector('h2')?.innerText; if (itemTitle.toLowerCase() === contentPageTitle.toLowerCase()) { item.querySelector('a').classList.add('is-active'); @@ -453,8 +453,10 @@ }); let initiatedMap = document.querySelector(`#${mapid}`); - const currentLibelle = initiatedMap.parentElement.nextElementSibling.innerText; - initiatedMap.parentElement.nextElementSibling.remove(); + const currentLibelle = initiatedMap.parentElement.nextElementSibling?.innerText; + if (currentLibelle) { + initiatedMap.parentElement.nextElementSibling.remove(); + } if (document.querySelectorAll('.leaflet-container').length <= 1) { firstMap = map; diff --git a/web/themes/erabletheme/scss/partials/_articles.scss b/web/themes/erabletheme/scss/partials/_articles.scss index 7cdfb05..439df0a 100644 --- a/web/themes/erabletheme/scss/partials/_articles.scss +++ b/web/themes/erabletheme/scss/partials/_articles.scss @@ -61,7 +61,7 @@ @include sous_titre(); } - .liens_fixed > div > div:nth-of-type(2), .file_fixed > div > div > div { + .liens_fixed > div > div:nth-of-type(2) > div, .file_fixed > div > div > div { padding: 0 calc($x_margin / 2); text-align: right; margin: 2rem 0;