From 3353e208b1d1c798243d70baa02bfa9088ffdaa3 Mon Sep 17 00:00:00 2001 From: ouidade Date: Sun, 23 Jun 2024 23:03:46 +0200 Subject: [PATCH] home presentation, page site --- web/themes/custom/reha/dist/bundle.js | 2 +- web/themes/custom/reha/dist/css/bundle.css | 78 ++++++++++++++++--- web/themes/custom/reha/js/reha.js | 27 ++++++- web/themes/custom/reha/reha.theme | 35 +++++---- .../pages/home/home-view-presentation.scss | 42 +++++++--- .../reha/scss/pages/home/home-view-sites.scss | 6 +- .../reha/scss/pages/les-sites-pilotes.scss | 1 + .../custom/reha/scss/pages/node-site.scss | 73 +++++++++++++---- ...lock--views-block--home-block-1.html.twig} | 51 +++++------- .../reha/templates/address-plain.html.twig | 59 ++++++++++++++ ...lock--views-block--sites-block-1.html.twig | 47 ----------- .../reha/templates/node--site.html.twig | 1 + .../reha/templates/page--home.html.twig | 2 +- 13 files changed, 292 insertions(+), 132 deletions(-) rename web/themes/custom/reha/templates/{block--views-block--actus-block-1.html.twig => __block--views-block--home-block-1.html.twig} (68%) create mode 100644 web/themes/custom/reha/templates/address-plain.html.twig delete mode 100644 web/themes/custom/reha/templates/block--views-block--sites-block-1.html.twig diff --git a/web/themes/custom/reha/dist/bundle.js b/web/themes/custom/reha/dist/bundle.js index a57c043..ec337b0 100644 --- a/web/themes/custom/reha/dist/bundle.js +++ b/web/themes/custom/reha/dist/bundle.js @@ -15,7 +15,7 @@ \********************/ /***/ (() => { -eval("/**\n * @file\n * reha behaviors.\n */\n(function (Drupal) {\n\n 'use strict';\n\n Drupal.behaviors.reha = {\n attach: function (context, settings) {\n\n console.log('It works!');\n\n }\n };\n\n \n} (Drupal));\n\njQuery(document).ready(function($){\n\n // menu déroulant\n\n ////////////// contacts ///////\n\n $(\".bouton-contact\").click(function(event) {\n // Fermer .connexion-full s'il est déroulé\n if ($(\".connexion-full\").is(\":visible\")) {\n $(\".connexion-full\").slideUp();\n }\n if ($(\".connected-full\").is(\":visible\")) {\n $(\".connected-full\").slideUp();\n }\n // Ouvrir .contacts-full\n $(\".contacts-full\").slideToggle();\n\n });\n\n////////////// connexion ///////\n\n $(\".bouton-connexion\").click(function(event) {\n // Fermer .contacts-full s'il est déroulé\n if ($(\".contacts-full\").is(\":visible\")) {\n $(\".contacts-full\").slideUp();\n }\n // Ouvrir .connexion-full\n $(\".connexion-full\").slideToggle();\n });\n \n $(\".bouton-connected\").click(function(event) {\n // Fermer .contacts-full s'il est déroulé\n if ($(\".contacts-full\").is(\":visible\")) {\n $(\".contacts-full\").slideUp();\n }\n // Ouvrir .connected-full\n $(\".connected-full\").slideToggle();\n });\n \n $(\".titre\").click(function(event) {\n if ($(\".connected-full\").is(\":visible\")) {\n $(\".connected-full\").slideUp();\n }\n if ($(\".contacts-full\").is(\":visible\")) {\n $(\".contacts-full\").slideUp();\n }\n if ($(\".connexion-full\").is(\":visible\")) {\n $(\".connexion-full\").slideUp();\n }\n // // Ouvrir .connexion-full\n // $(\".connected-full\").slideToggle();\n });\n \n $(\"#edit-field-dossier-de-candidature-0--label\").click(function(event) {\n event.preventDefault();\n // Ouvrir .connexion-full\n $(\"#edit-field-dossier-de-candidature-0--description>ul.main\").slideToggle();\n });\n\n});\n\n\n// slideshow home \n\n(function($, window) {\n console.log('hello slick')\n $(document).ready(function(){\n $('.view-id-sites.view-display-id-block_1').slick({\n slidesToShow: 1,\n // slidesToScroll: 1,\n dots: false,\n arrows: true,\n centerMode: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: true,\n arrows: false,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n console.log('salut slick home');\n\n });\n\n $(document).ready(function(){\n $('.view-id-actus.view-display-id-block_1').slick({\n slidesToShow: 3,\n // slidesToScroll: 1,\n dots: false,\n arrows: true,\n centerMode: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: true,\n arrows: false,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n console.log('slick actu');\n\n});\n\n})(jQuery, window);\n\n\n// document.addEventListener('DOMContentLoaded', function() {\n// var nav = document.querySelectorAll('main-nav');\n// var links = nav.querySelectorAll('li > a');\n// console.log(links);\n\n\n// links.forEach(function(link) {\n// if (link.classList.contains('is-active')) {\n// nav.classList.add('has-active');\n// }\n// });\n// });\n\n\n\n// /////////////////\n//// ancre dans texte au click parragraphe correspondant arrive en dessous du header \n\n\n// (function($, window) {\n// var adjustAnchor = function() {\n// var $anchor = $('.block-views-blockhome-block-1'),\n// fixedElementHeight = 350;\n// if ($anchor.length > 0) {\n// $('html, body').stop().animate({scrollTop: $anchor.offset().top - fixedElementHeight }, 0);\n// }\n// };\n\n// $(window).on('hashchange', function() {\n// adjustAnchor();\n// });\n\n// })(jQuery, window);\n\n//# sourceURL=webpack://dev.reha.fr/./js/reha.js?"); +eval("/**\n * @file\n * reha behaviors.\n */\n(function (Drupal) {\n\n 'use strict';\n\n Drupal.behaviors.reha = {\n attach: function (context, settings) {\n\n console.log('It works!');\n\n }\n };\n\n \n} (Drupal));\n\njQuery(document).ready(function($){\n\n // menu déroulant\n\n ////////////// contacts ///////\n\n $(\".bouton-contact\").click(function(event) {\n // Fermer .connexion-full s'il est déroulé\n if ($(\".connexion-full\").is(\":visible\")) {\n $(\".connexion-full\").slideUp();\n }\n if ($(\".connected-full\").is(\":visible\")) {\n $(\".connected-full\").slideUp();\n }\n // Ouvrir .contacts-full\n $(\".contacts-full\").slideToggle();\n\n });\n\n////////////// connexion ///////\n\n $(\".bouton-connexion\").click(function(event) {\n // Fermer .contacts-full s'il est déroulé\n if ($(\".contacts-full\").is(\":visible\")) {\n $(\".contacts-full\").slideUp();\n }\n // Ouvrir .connexion-full\n $(\".connexion-full\").slideToggle();\n });\n \n $(\".bouton-connected\").click(function(event) {\n // Fermer .contacts-full s'il est déroulé\n if ($(\".contacts-full\").is(\":visible\")) {\n $(\".contacts-full\").slideUp();\n }\n // Ouvrir .connected-full\n $(\".connected-full\").slideToggle();\n });\n \n $(\".titre\").click(function(event) {\n if ($(\".connected-full\").is(\":visible\")) {\n $(\".connected-full\").slideUp();\n }\n if ($(\".contacts-full\").is(\":visible\")) {\n $(\".contacts-full\").slideUp();\n }\n if ($(\".connexion-full\").is(\":visible\")) {\n $(\".connexion-full\").slideUp();\n }\n // // Ouvrir .connexion-full\n // $(\".connected-full\").slideToggle();\n });\n \n $(\"#edit-field-dossier-de-candidature-0--label\").click(function(event) {\n event.preventDefault();\n // Ouvrir .connexion-full\n $(\"#edit-field-dossier-de-candidature-0--description>ul.main\").slideToggle();\n });\n\n});\n\n\n// slideshow home \n\n(function($, window) {\n console.log('hello slick')\n $(document).ready(function(){\n $('.view-id-sites.view-display-id-block_1').slick({\n slidesToShow: 1,\n // slidesToScroll: 1,\n dots: false,\n arrows: true,\n centerMode: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: true,\n arrows: false,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n console.log('salut slick home');\n\n });\n\n $(document).ready(function(){\n $('.view-id-actus.view-display-id-block_1').slick({\n slidesToShow: 3,\n // slidesToScroll: 1,\n dots: false,\n arrows: true,\n centerMode: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: true,\n arrows: false,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n console.log('slick actu');\n });\n\n // $(document).ready(function(){\n // $('.field--name-field-image > div:nth-child(2)').slick({\n // slidesToShow: 1,\n // slidesToScroll: 1,\n // dots: true,\n // arrows: false,\n // centerMode: true,\n // // centerPadding: '100px',\n // responsive: [\n // {\n // breakpoint: 810,\n // settings: {\n // slidesToShow: 1,\n // adaptiveHeight: true,\n // arrows: false,\n // draggable: true,\n // centerMode: true,\n // }\n // }]\n // });\n // console.log('slick site'); \n\n// });\n\n\n\n})(jQuery, window);\n\n\n// document.addEventListener('DOMContentLoaded', function() {\n// var nav = document.querySelectorAll('main-nav');\n// var links = nav.querySelectorAll('li > a');\n// console.log(links);\n\n\n// links.forEach(function(link) {\n// if (link.classList.contains('is-active')) {\n// nav.classList.add('has-active');\n// }\n// });\n// });\n\n\n\n// /////////////////\n//// ancre dans texte au click parragraphe correspondant arrive en dessous du header \n\n\n// (function($, window) {\n// var adjustAnchor = function() {\n// var $anchor = $('.block-views-blockhome-block-1'),\n// fixedElementHeight = 350;\n// if ($anchor.length > 0) {\n// $('html, body').stop().animate({scrollTop: $anchor.offset().top - fixedElementHeight }, 0);\n// }\n// };\n\n// $(window).on('hashchange', function() {\n// adjustAnchor();\n// });\n\n// })(jQuery, window);\n\n//# sourceURL=webpack://dev.reha.fr/./js/reha.js?"); /***/ }), diff --git a/web/themes/custom/reha/dist/css/bundle.css b/web/themes/custom/reha/dist/css/bundle.css index aa892cc..6328110 100644 --- a/web/themes/custom/reha/dist/css/bundle.css +++ b/web/themes/custom/reha/dist/css/bundle.css @@ -1725,6 +1725,7 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div } .home-page-layout-content .block-views-blocksites-block-1 .views-row .node-type-site .image-site img { height: 500px; + width: auto; } .home-page-layout-content .block-views-blocksites-block-1 .views-row .node-type-site .filtered-content { background-color: rgb(255, 255, 255); @@ -1735,12 +1736,16 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div grid-row: 7/span 5; grid-column: 7/span 9; padding: 1rem; + z-index: 99; } @media (max-width: 891px) { .home-page-layout-content .block-views-blocksites-block-1 .views-row .node-type-site .filtered-content { width: auto; } } +.home-page-layout-content .block-views-blocksites-block-1 .views-row .node-type-site .filtered-content h1 { + display: none; +} .home-page-layout-content .block-views-blocksites-block-1 .views-row .node-type-site .filtered-content h2 { order: 2; margin: 0; @@ -1793,6 +1798,8 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div .home-page-layout-content .block-block-content9e601647-144f-4e8e-b9e1-7d744f9141d7 { width: fit-content; margin: auto; + z-index: 99; + position: relative; } .view-display-id-page_1 { @@ -1831,6 +1838,9 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div padding-left: 1rem; padding-right: 1rem; } +.view-display-id-page_1 .views-row .node-type-site .filtered-content h1 { + display: none; +} .view-display-id-page_1 .views-row .node-type-site .filtered-content h2 { order: 2; margin: 0; @@ -2053,17 +2063,34 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div display: none; } -.block-views-blockhome-block-1 .view-display-id-block_1 { +.page--home .home-page-layout-content .block-views-blockhome-block-1 .view-display-id-block_1 { width: 60%; margin: auto; padding-top: 5rem; + max-height: 300px; + overflow: hidden; + text-overflow: ellipsis; + /* Masquer tous les paragraphes après le premier */ } @media (max-width: 891px) { - .block-views-blockhome-block-1 .view-display-id-block_1 { + .page--home .home-page-layout-content .block-views-blockhome-block-1 .view-display-id-block_1 { width: 80%; padding-top: 3rem; } } +.page--home .home-page-layout-content .block-views-blockhome-block-1 .view-display-id-block_1 .field-content p:nth-of-type(n+2), .page--home .home-page-layout-content .block-views-blockhome-block-1 .view-display-id-block_1 h3, .page--home .home-page-layout-content .block-views-blockhome-block-1 .view-display-id-block_1 ul { + display: none; +} +.page--home .home-page-layout-content .block-block-content793e5016-2b96-4802-9f38-1cd3768775b5 { + width: fit-content; + margin: auto; + z-index: 99; + position: relative; + margin-top: 2rem; +} +.page--home .home-page-layout-content .block-block-content793e5016-2b96-4802-9f38-1cd3768775b5 .field--type-link .field__item::after { + content: url("../dist/images/noun-arrow-1569918-black.svg"); +} .page-programme .block-region-first { padding-left: 18%; @@ -2126,29 +2153,59 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div width: 80%; margin: auto; } +.page-node-site .region-content #block-reha-titredepage { + display: none; +} .page-node-site .region-content .node-type-site { margin: auto; display: flex; flex-direction: column; - width: 100%; - background-color: white; } -.page-node-site .region-content .node-type-site .field--name-field-image { +.page-node-site .region-content .node-type-site .image-site { order: 2; - max-width: 100%; + top: -150px; + position: relative; } -.page-node-site .region-content .node-type-site .field--name-field-image img { +.page-node-site .region-content .node-type-site .image-site .field--name-field-image { + width: 80%; + margin: auto; +} +.page-node-site .region-content .node-type-site .image-site .field--name-field-image .field__item { + display: flex; + flex-direction: row; +} +.page-node-site .region-content .node-type-site .image-site .field--name-field-image .field__item img { width: 100%; object-fit: cover; height: fit-content; } +.page-node-site .region-content .node-type-site .image-site .field--name-field-image .field__item blockquote { + align-self: flex-end; + font-style: italic; + margin: 0; + width: 10%; +} +.page-node-site .region-content .node-type-site .image-site .field--name-field-image .field__item blockquote p { + margin: 0; + padding-left: 1rem; +} .page-node-site .region-content .node-type-site .filtered-content { + z-index: 99; background-color: rgb(255, 255, 255); + width: 25vw; order: 1; display: flex; flex-direction: column; padding-left: 1rem; padding-right: 1rem; + padding-bottom: 4rem; + padding-top: 1rem; +} +.page-node-site .region-content .node-type-site .filtered-content h1 { + order: 2; + margin: 0; + font-size: 1.3rem; + font-weight: 900; } .page-node-site .region-content .node-type-site .filtered-content h2 { order: 2; @@ -2163,8 +2220,8 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div } .page-node-site .region-content .node-type-site .filtered-content .field--name-field-adresse-site { order: 3; - font-size: 1.3rem; - line-height: 0.3rem; + font-size: 1rem; + line-height: 1.3rem; } .page-node-site .region-content .node-type-site .filtered-content .field--name-field-adresse-site .address { margin: 0; @@ -2181,6 +2238,9 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div .page-node-site .region-content .node-type-site .filtered-content .field--name-field-adresse-site .address .country { display: none; } +.page-node-site .region-content .node-type-site .filtered-content .field--name-field-date-de-construction { + order: 5; +} .page-node-site .region-content .node-type-site .filtered-content .field--name-field-architecte { order: 4; padding-top: 1rem; diff --git a/web/themes/custom/reha/js/reha.js b/web/themes/custom/reha/js/reha.js index 1eeb0b9..a222de9 100644 --- a/web/themes/custom/reha/js/reha.js +++ b/web/themes/custom/reha/js/reha.js @@ -128,8 +128,33 @@ jQuery(document).ready(function($){ }] }); console.log('slick actu'); + }); + + // $(document).ready(function(){ + // $('.field--name-field-image > div:nth-child(2)').slick({ + // slidesToShow: 1, + // slidesToScroll: 1, + // dots: true, + // arrows: false, + // centerMode: true, + // // centerPadding: '100px', + // responsive: [ + // { + // breakpoint: 810, + // settings: { + // slidesToShow: 1, + // adaptiveHeight: true, + // arrows: false, + // draggable: true, + // centerMode: true, + // } + // }] + // }); + // console.log('slick site'); + +// }); + -}); })(jQuery, window); diff --git a/web/themes/custom/reha/reha.theme b/web/themes/custom/reha/reha.theme index 0c37386..4aa262d 100644 --- a/web/themes/custom/reha/reha.theme +++ b/web/themes/custom/reha/reha.theme @@ -91,23 +91,26 @@ function reha_preprocess_html(&$variables) { /** * Implements hook_preprocess_HOOK() for page templates. */ -function reha_preprocess_page(&$variables) { - // Vérifiez si c'est une page de nœud. - if ($node = \Drupal::routeMatch()->getParameter('node')) { - if ($node instanceof \Drupal\node\NodeInterface) { - // Ajoutez une classe unique basée sur le nid (Node ID). - $variables['attributes']['class'][] = 'page-node-' . $node->id(); +// function reha_preprocess_page(&$variables) { +// // Vérifiez si c'est une page de nœud. +// if ($node = \Drupal::routeMatch()->getParameter('node')) { +// if ($node instanceof \Drupal\node\NodeInterface) { +// // Ajoutez une classe unique basée sur le nid (Node ID). +// $variables['attributes']['class'][] = 'page-node-' . $node->id(); + +// // Ajoutez un ID unique basé sur le nid. +// $variables['attributes']['id'] = 'page-node-' . $node->id(); +// } +// } +// else { +// // Si ce n'est pas une page de nœud, vous pouvez ajouter un ID basé sur le nom de la route. +// $route_name = \Drupal::routeMatch()->getRouteName(); +// $variables['attributes']['id'] = 'page-' . str_replace('.', '-', $route_name); +// } + +// } + - // Ajoutez un ID unique basé sur le nid. - $variables['attributes']['id'] = 'page-node-' . $node->id(); - } - } - else { - // Si ce n'est pas une page de nœud, vous pouvez ajouter un ID basé sur le nom de la route. - $route_name = \Drupal::routeMatch()->getRouteName(); - $variables['attributes']['id'] = 'page-' . str_replace('.', '-', $route_name); - } -} // /** diff --git a/web/themes/custom/reha/scss/pages/home/home-view-presentation.scss b/web/themes/custom/reha/scss/pages/home/home-view-presentation.scss index 7862d80..380ffaf 100644 --- a/web/themes/custom/reha/scss/pages/home/home-view-presentation.scss +++ b/web/themes/custom/reha/scss/pages/home/home-view-presentation.scss @@ -1,13 +1,37 @@ -.block-views-blockhome-block-1{ +.page--home{ - .view-display-id-block_1{ - width: 60%; - margin: auto; - padding-top: 5rem; - @media(max-width: 891px){ - width: 80%; - padding-top: 3rem; + .home-page-layout-content{ + .block-views-blockhome-block-1{ + + .view-display-id-block_1{ + width: 60%; + margin: auto; + padding-top: 5rem; + max-height: 300px; + overflow: hidden; + text-overflow: ellipsis; + @media(max-width: 891px){ + width: 80%; + padding-top: 3rem; + } + /* Masquer tous les paragraphes après le premier */ + .field-content p:nth-of-type(n+2), h3, ul { + display: none; + } + } + } + + .block-block-content793e5016-2b96-4802-9f38-1cd3768775b5{ + width: fit-content; + margin: auto; + z-index: 99; + position: relative; + margin-top: 2rem; + .field--type-link{ + .field__item::after{ + content: url('../dist/images/noun-arrow-1569918-black.svg'); + } + } } - } } \ No newline at end of file diff --git a/web/themes/custom/reha/scss/pages/home/home-view-sites.scss b/web/themes/custom/reha/scss/pages/home/home-view-sites.scss index 3a5b3e4..d6eff20 100644 --- a/web/themes/custom/reha/scss/pages/home/home-view-sites.scss +++ b/web/themes/custom/reha/scss/pages/home/home-view-sites.scss @@ -53,7 +53,7 @@ // // object-fit: cover; // height: auto; height: 500px; - + width: auto; } } .filtered-content{ @@ -66,9 +66,11 @@ grid-row: 7/span 5; grid-column: 7/span 9; padding: 1rem; + z-index: 99; @media(max-width: 891px){ width: auto; } + h1{display: none;} h2{ order: 2; margin: 0; @@ -122,5 +124,7 @@ width: fit-content; margin: auto; + z-index: 99; + position: relative; } } diff --git a/web/themes/custom/reha/scss/pages/les-sites-pilotes.scss b/web/themes/custom/reha/scss/pages/les-sites-pilotes.scss index d50eb76..b0683dc 100644 --- a/web/themes/custom/reha/scss/pages/les-sites-pilotes.scss +++ b/web/themes/custom/reha/scss/pages/les-sites-pilotes.scss @@ -33,6 +33,7 @@ flex-direction: column; padding-left: 1rem; padding-right: 1rem; + h1{display: none;} h2{ order: 2; margin: 0; diff --git a/web/themes/custom/reha/scss/pages/node-site.scss b/web/themes/custom/reha/scss/pages/node-site.scss index 1f95b4d..6160cb1 100644 --- a/web/themes/custom/reha/scss/pages/node-site.scss +++ b/web/themes/custom/reha/scss/pages/node-site.scss @@ -8,34 +8,76 @@ } } .region-content{ + width: 80%; margin: auto; + + #block-reha-titredepage{ + display: none; + // background-color: white; + // width: 25vw; + // padding-top: 1rem; + // padding-left: 1rem; + // padding-right: 1rem; + // font-size: 0.8rem; + // h1{ + // margin: 0 ; + // } + } .node-type-site{ margin: auto; display: flex; flex-direction: column; - // display: grid; - // grid-template-columns: repeat(7, 1fr); - // grid-template-rows: repeat(5, 1fr) ; - width: 100%; - background-color: white; - .field--name-field-image{ + .image-site{ order: 2; - max-width: 100%; - img{ - width: 100%; - object-fit: cover; - height: fit-content; + top: -150px; + position: relative; + .field--name-field-image{ + // position: relative; + // order: 2; + width: 80%; + margin: auto; + // max-width: 100%; + .field__item{ + display: flex; + flex-direction: row; + img{ + width: 100%; + object-fit: cover; + height: fit-content; + } + blockquote{ + align-self: flex-end; + font-style: italic; + margin: 0; + width: 10%; + + p{ + margin: 0; + padding-left: 1rem; + } + } + } } } + .filtered-content{ - // border: solid $yellow-puca 1px; + z-index: 99; background-color: $white-button; + width: 25vw; order: 1; display: flex; flex-direction: column; padding-left: 1rem; padding-right: 1rem; + padding-bottom: 4rem; + padding-top: 1rem; + h1{ + order: 2; + margin: 0; + font-size: 1.3rem; + font-weight: 900; + } h2{ order: 2; margin: 0; @@ -50,8 +92,8 @@ } .field--name-field-adresse-site{ order: 3; - font-size: 1.3rem; - line-height: 0.3rem; + font-size: 1rem; + line-height: 1.3rem; .address{ margin: 0; @@ -69,6 +111,9 @@ } } } + .field--name-field-date-de-construction{ + order: 5; + } .field--name-field-architecte{ order: 4; padding-top: 1rem; diff --git a/web/themes/custom/reha/templates/block--views-block--actus-block-1.html.twig b/web/themes/custom/reha/templates/__block--views-block--home-block-1.html.twig similarity index 68% rename from web/themes/custom/reha/templates/block--views-block--actus-block-1.html.twig rename to web/themes/custom/reha/templates/__block--views-block--home-block-1.html.twig index 30fc383..b8b0a1c 100644 --- a/web/themes/custom/reha/templates/block--views-block--actus-block-1.html.twig +++ b/web/themes/custom/reha/templates/__block--views-block--home-block-1.html.twig @@ -41,38 +41,23 @@ {{ label }} {% endif %} {{ title_suffix }} - {% block content %} - {{ content }} - {% endblock %} - -{# {% - set classes = [ - 'block', - 'block-' ~ configuration.provider|clean_class, - 'block-' ~ plugin_id|clean_class, - ] -%} - - {{ title_prefix }} - {% if label %} - {{ label }} - {% endif %} - {{ title_suffix }} - - {% block content %} - {# Afficher le contenu exclu séparément #} - {# {% if excluded_field_content %} -
- {{ excluded_field_content }} -
- {% endif %} - - {# Afficher le contenu filtré #} - {#
- {% for field_name, field_content in filtered_content %} - {{ field_content }} +
+ {% if content %} + {% set displayed_first_paragraph = false %} + {% for key, item in content %} + {% if item['#markup'] is defined and not displayed_first_paragraph %} + {# Split the content by paragraphs #} + {% set paragraphs = item['#markup']|split('

') %} + {# Display the first paragraph only #} +

{{ paragraphs[0]|striptags }}

+ {# Add a "Voir plus" button that links to the full content page #} + Voir plus + {% set displayed_first_paragraph = true %} + {% elseif not displayed_first_paragraph %} + {{ item }} + {% endif %} {% endfor %} -
- {% endblock %} -
#} \ No newline at end of file + {% endif %} + + diff --git a/web/themes/custom/reha/templates/address-plain.html.twig b/web/themes/custom/reha/templates/address-plain.html.twig new file mode 100644 index 0000000..3321013 --- /dev/null +++ b/web/themes/custom/reha/templates/address-plain.html.twig @@ -0,0 +1,59 @@ +{# +/** + * @file + * Default template for the 'plain' address formatter. + * + * Available variables: + * - given_name: Given name. + * - additional_name: Additional name. + * - family_name: Family name. + * - organization: Organization. + * - address_line1: First address line. + * - address_line2: Second address line. + * - postal_code: Postal code. + * - sorting_code: Sorting code. + * - dependent_locality: The dependent locality. + * - dependent_locality.code: Dependent locality code. + * - dependent_locality.name: Dependent locality name. + * - locality: The locality subdivision. + * - locality.code: Locality code. + * - locality.name: Locality name. + * - administrative_area: The administrative area subdivision. + * - administrative_area.code: Administrative area code. + * - administrative_area.name: Administrative area name. + * - country: The country. + * - country.code: Country code. + * - country.name: Country name. + * - address: An object that implements \Drupal\address\AddressInterface + * representing the address to be rendered. Only public methods can be used. + * - view_mode: View mode of the entity being rendered that this address field + * is attached to. For example, "teaser" or "full". + * + * if a subdivision (dependent_locality, locality, administrative_area) was + * entered, the array will always have a code. If it's a predefined subdivision, + * it will also have a name. The code is always preferred. + * + * @ingroup themeable + */ +#} +

+ {% if given_name or family_name %} + {{ given_name }} {{ family_name }}
+ {% endif %} + {% if organization %} + {{ organization }}
+ {% endif %} + {% if address_line1 %} + {{ address_line1 }}
+ {% endif %} + {% if address_line2 %} + {{ address_line2 }}
+ {% endif %} + {% if dependent_locality.code %} + {{ dependent_locality.code }}
+ {% endif %} + {% if locality.code or postal_code or administrative_area.code %} + {{ locality.code }} {{ postal_code }} {{ administrative_area.code }}
+ {% endif %} + {{ country.name }} +

diff --git a/web/themes/custom/reha/templates/block--views-block--sites-block-1.html.twig b/web/themes/custom/reha/templates/block--views-block--sites-block-1.html.twig deleted file mode 100644 index 57d1d41..0000000 --- a/web/themes/custom/reha/templates/block--views-block--sites-block-1.html.twig +++ /dev/null @@ -1,47 +0,0 @@ -{# -/** - * @file - * Default theme implementation to display a block. - * - * Available variables: - * - plugin_id: The ID of the block implementation. - * - label: The configured label of the block if visible. - * - configuration: A list of the block's configuration values. - * - label: The configured label for the block. - * - label_display: The display settings for the label. - * - provider: The module or other provider that provided this block plugin. - * - Block plugin specific settings will also be stored here. - * - in_preview: Whether the plugin is being rendered in preview mode. - * - content: The content of this block. - * - attributes: array of HTML attributes populated by modules, intended to - * be added to the main container tag of this template. - * - id: A valid HTML ID and guaranteed unique. - * - title_attributes: Same as attributes, except applied to the main title - * tag that appears in the template. - * - title_prefix: Additional output populated by modules, intended to be - * displayed in front of the main title tag that appears in the template. - * - title_suffix: Additional output populated by modules, intended to be - * displayed after the main title tag that appears in the template. - * - * @see template_preprocess_block() - * - * @ingroup themeable - */ -#} -{% - set classes = [ - 'block', - 'block-' ~ configuration.provider|clean_class, - 'block-' ~ plugin_id|clean_class, - ] -%} - - {{ title_prefix }} - {% if label %} - {{ label }} - {% endif %} - {{ title_suffix }} - {% block content %} - {{ content }} - {% endblock %} - diff --git a/web/themes/custom/reha/templates/node--site.html.twig b/web/themes/custom/reha/templates/node--site.html.twig index 988e96e..875514b 100644 --- a/web/themes/custom/reha/templates/node--site.html.twig +++ b/web/themes/custom/reha/templates/node--site.html.twig @@ -107,6 +107,7 @@ {# Envelopper le titre et tous les autres champs dans une nouvelle div #}
+

{{ node.label }}

{% if label and not page %} {{ label }} diff --git a/web/themes/custom/reha/templates/page--home.html.twig b/web/themes/custom/reha/templates/page--home.html.twig index e1d7109..6468fca 100644 --- a/web/themes/custom/reha/templates/page--home.html.twig +++ b/web/themes/custom/reha/templates/page--home.html.twig @@ -45,7 +45,7 @@ * @ingroup themeable */ #} -
+
{{ page.header }}