From d3dd44d0094b062f60358e3bde02d6ea1f343663 Mon Sep 17 00:00:00 2001 From: ouidade Date: Wed, 3 Jul 2024 11:53:36 +0200 Subject: [PATCH] =?UTF-8?q?fichers=20synth=C3=A8se=20tous=20sites=20block-?= =?UTF-8?q?config-3=20affichage=20avec=20js=20&=20css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/themes/custom/reha/dist/bundle.js | 2 +- web/themes/custom/reha/dist/css/bundle.css | 35 ++++-- web/themes/custom/reha/js/reha.js | 15 +++ web/themes/custom/reha/reha.theme | 116 +++++++++--------- .../reha/scss/global/variables/_buttons.scss | 1 + .../custom/reha/scss/pages/node-site.scss | 62 ++++++---- ...fiche-de-synthese-de-tous-les-si.html.twig | 48 ++++++++ .../reha/templates/node--site.html.twig | 25 +--- 8 files changed, 186 insertions(+), 118 deletions(-) create mode 100644 web/themes/custom/reha/templates/block--config-pages--fiche-de-synthese-de-tous-les-si.html.twig diff --git a/web/themes/custom/reha/dist/bundle.js b/web/themes/custom/reha/dist/bundle.js index a93448d..9993072 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 ////////////// tiroir fichiers ///////\n\n $(document).ready(function() {\n // Vérifier l'état initial depuis sessionStorage\n if (sessionStorage.getItem('asideOpened') === 'true') {\n $(\".layout-sidebar-second\").addClass('close');\n $(\"h2\").addClass('__close');\n }\n\n $(\".view-current-user-doc-profile\").click(function(event) {\n // Ouvrir .tiroir fichiers\n $(\".layout-sidebar-second\").addClass('close');\n $(\"h2\").addClass('__close');\n sessionStorage.setItem('asideOpened', 'true');\n });\n\n $(\"#block-reha-views-block-current-user-doc-profile-block-1 > h2\").click(function(event) {\n // Fermer .tiroir fichiers\n $(\".layout-sidebar-second\").removeClass('close');\n $(\"h2\").removeClass('__close');\n sessionStorage.setItem('asideOpened', 'false');\n });\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 adaptiveHeight: 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 // html.js body.node-type-site.node-id-58 div.dialog-off-canvas-main-canvas div.layout-container.page-node-site main div.layout-content.home-page-layout-content div.region.region-content div#block-reha-contenudelapageprincipale.block.block-system.block-system-main-block article.node-type-site div.entete_site div.image-site div.field.field--name-field-image.field--type-image.field--label-visually_hidden div.field__items\n $(document).ready(function(){\n $('.page-node-site .field--name-field-image .field__items').slick({\n slidesToShow: 1,\n // slidesToScroll: 1,\n dots: true,\n arrows: false,\n // adaptiveHeight: 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 site');\n });\n\n\n \n\n// /////////////////\n//// ancre dans texte au click parragraphe correspondant arrive en dessous du header \n\nfunction adjustAnchor() {\n var $anchor = $(window.location.hash); // Select the anchor element based on the hash in the URL\n var fixedElementHeight = $('.block-region-first').outerHeight(); // Get the height of the sticky element\n\n if ($anchor.length > 0) {\n $('html, body').stop().animate({\n scrollTop: $anchor.offset().top - fixedElementHeight // Adjust the scroll position to account for the sticky element height\n }, 0);\n }\n}\n\n// Call the function on page load if there's a hash\nif (window.location.hash) {\n adjustAnchor();\n}\n\n// Adjust the anchor on hash change\n$(window).on('hashchange', function() {\n adjustAnchor();\n});\n\n\n\n//////////////////////////////////////////\n// menu ancre paragraphe quand actif\n \njQuery(function($) {\n // Function to set the active class based on the current path\n function setActiveLink() {\n var path = window.location.href;\n console.log(path);\n $(\".layout__region--first .block-region-first li a\").each(function() {\n if (this.href === path) {\n $(this).closest('a').addClass('active');\n }\n });\n }\n\n // Initially set the active link based on the current URL\n setActiveLink();\n\n // Update the active link on click\n $(\".layout__region--first .block-region-first li a\").on('click', function() {\n $(\".layout__region--first .block-region-first li a\").removeClass('active');\n $(this).addClass('active');\n });\n});\n\n\n})(jQuery, window);\n\n\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 ////////////// tiroir fichiers ///////\n\n $(document).ready(function() {\n // Vérifier l'état initial depuis sessionStorage\n if (sessionStorage.getItem('asideOpened') === 'true') {\n $(\".layout-sidebar-second\").addClass('close');\n $(\"h2\").addClass('__close');\n }\n\n $(\".view-current-user-doc-profile\").click(function(event) {\n // Ouvrir .tiroir fichiers\n $(\".layout-sidebar-second\").addClass('close');\n $(\"h2\").addClass('__close');\n sessionStorage.setItem('asideOpened', 'true');\n });\n\n $(\"#block-reha-views-block-current-user-doc-profile-block-1 > h2\").click(function(event) {\n // Fermer .tiroir fichiers\n $(\".layout-sidebar-second\").removeClass('close');\n $(\"h2\").removeClass('__close');\n sessionStorage.setItem('asideOpened', 'false');\n });\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 adaptiveHeight: 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 // html.js body.node-type-site.node-id-58 div.dialog-off-canvas-main-canvas div.layout-container.page-node-site main div.layout-content.home-page-layout-content div.region.region-content div#block-reha-contenudelapageprincipale.block.block-system.block-system-main-block article.node-type-site div.entete_site div.image-site div.field.field--name-field-image.field--type-image.field--label-visually_hidden div.field__items\n $(document).ready(function(){\n $('.page-node-site .field--name-field-image .field__items').slick({\n slidesToShow: 1,\n // slidesToScroll: 1,\n dots: true,\n arrows: false,\n // adaptiveHeight: 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 site');\n });\n\n\n \n\n// /////////////////\n//// ancre dans texte au click parragraphe correspondant arrive en dessous du header \n\nfunction adjustAnchor() {\n var $anchor = $(window.location.hash); // Select the anchor element based on the hash in the URL\n var fixedElementHeight = $('.block-region-first').outerHeight(); // Get the height of the sticky element\n\n if ($anchor.length > 0) {\n $('html, body').stop().animate({\n scrollTop: $anchor.offset().top - fixedElementHeight // Adjust the scroll position to account for the sticky element height\n }, 0);\n }\n}\n\n// Call the function on page load if there's a hash\nif (window.location.hash) {\n adjustAnchor();\n}\n\n// Adjust the anchor on hash change\n$(window).on('hashchange', function() {\n adjustAnchor();\n});\n\n\n\n//////////////////////////////////////////\n// menu ancre paragraphe quand actif\n \njQuery(function($) {\n // Function to set the active class based on the current path\n function setActiveLink() {\n var path = window.location.href;\n console.log(path);\n $(\".layout__region--first .block-region-first li a\").each(function() {\n if (this.href === path) {\n $(this).closest('a').addClass('active');\n }\n });\n }\n\n // Initially set the active link based on the current URL\n setActiveLink();\n\n // Update the active link on click\n $(\".layout__region--first .block-region-first li a\").on('click', function() {\n $(\".layout__region--first .block-region-first li a\").removeClass('active');\n $(this).addClass('active');\n });\n});\n\n\n})(jQuery, window);\n\n\n/////////////////// déplace synthèse de tous les sites (dans block config 3) dans node site pour faciliter css ///////////////////\n\n(function ($, Drupal) {\n Drupal.behaviors.moveFieldContent = {\n attach: function (context, settings) {\n // Vérifiez que les éléments existent avant de tenter de les manipuler\n if ($('#block-reha-config-pages-3 .field--name-field-fichier', context).length && $('.node-type-site .body-content-site .links-content', context).length) {\n // Déplacer le contenu de .field--name-field-fichier vers .links-content\n var fieldContent = $('#block-reha-config-pages-3 .field--name-field-fichier', context).detach();\n $('.node-type-site .body-content-site .links-content', context).append(fieldContent);\n }\n }\n };\n})(jQuery, Drupal);\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 5ff83af..33435c0 100644 --- a/web/themes/custom/reha/dist/css/bundle.css +++ b/web/themes/custom/reha/dist/css/bundle.css @@ -2724,15 +2724,15 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div margin: auto; } .page-node-site .region-content { - width: 80%; - margin: auto; - display: flex; - flex-direction: column; + display: grid; + grid-template-columns: repeat(8 1fr); + grid-template-rows: repeat(3 auto); } .page-node-site .region-content #block-reha-prevnextblock { display: flex; flex-direction: row; - width: 1274px; + width: 70%; + grid-column: 1/span 8; grid-row: 1; z-index: 97; height: fit-content; @@ -2765,6 +2765,8 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div .page-node-site .region-content #block-reha-contenudelapageprincipale { padding-top: 2rem; padding-bottom: 3rem; + grid-column: 1/span 8; + grid-row: 2; } .page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site { margin: auto; @@ -2774,7 +2776,7 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div .page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site { background-color: white; height: 520px; - width: 1274px; + width: 70%; display: flex; flex-direction: row; margin: auto; @@ -2924,26 +2926,35 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div order: 3; padding-top: 6rem; position: relative; - width: 50%; + width: 70%; margin: auto; font-size: 1.3rem; + display: flex; + flex-direction: row-reverse; + justify-content: space-between; } -.page-node-site .region-content #block-reha-config-pages-3 { - width: 15vw; +.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .body-content-site .summary-content { + width: 75%; } -.page-node-site .region-content #block-reha-config-pages-3 .field--name-field-fichier { +.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .body-content-site .links-content { + width: 15%; + margin-top: 1.5rem; +} +.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .body-content-site .links-content .field--type-file { border: none; margin-bottom: 1rem; background-color: transparent; } -.page-node-site .region-content #block-reha-config-pages-3 .field--name-field-fichier .field__item { - text-transform: uppercase; +.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .body-content-site .links-content .field__item { padding: 0.3rem; border: solid black 1px; margin-bottom: 1rem; background-color: rgb(255, 255, 255); font-size: 0.9rem; } +.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .body-content-site .links-content .field__item > * { + text-transform: uppercase; +} .page-ressources h1 { width: 80%; diff --git a/web/themes/custom/reha/js/reha.js b/web/themes/custom/reha/js/reha.js index 2f62ada..90f985d 100644 --- a/web/themes/custom/reha/js/reha.js +++ b/web/themes/custom/reha/js/reha.js @@ -237,3 +237,18 @@ jQuery(function($) { })(jQuery, window); + +/////////////////// déplace synthèse de tous les sites (dans block config 3) dans node site pour faciliter css /////////////////// + +(function ($, Drupal) { + Drupal.behaviors.moveFieldContent = { + attach: function (context, settings) { + // Vérifiez que les éléments existent avant de tenter de les manipuler + if ($('#block-reha-config-pages-3 .field--name-field-fichier', context).length && $('.node-type-site .body-content-site .links-content', context).length) { + // Déplacer le contenu de .field--name-field-fichier vers .links-content + var fieldContent = $('#block-reha-config-pages-3 .field--name-field-fichier', context).detach(); + $('.node-type-site .body-content-site .links-content', context).append(fieldContent); + } + } + }; +})(jQuery, Drupal); \ No newline at end of file diff --git a/web/themes/custom/reha/reha.theme b/web/themes/custom/reha/reha.theme index 9baa1a7..735384c 100644 --- a/web/themes/custom/reha/reha.theme +++ b/web/themes/custom/reha/reha.theme @@ -6,6 +6,8 @@ use Drupal\Core\Link; use Drupal\Core\Render\Markup; use Drupal\Component\Utility\Html; use Drupal\user\Entity\User; +use Drupal\block\Entity\Block; +use Drupal\Core\Render\Element; /** * @file @@ -29,58 +31,61 @@ function reha_preprocess_html(&$variables) { * Implements hook_preprocess_HOOK() for node.html.twig. */ - function reha_preprocess_node(&$variables) { - $node = &$variables['node']; - $variables['attributes']['class'][] = 'node-type-' . $node->gettype(); - - if ($node->getType() == 'site' || $node->getType() == 'ressource' || $node->getType() == 'actualite') { - $fields_to_exclude = [ - 'field_image', // Remplacez par le nom machine exact de votre champ image - ]; - - $filtered_content = []; - $image_field_content = ''; - $body_field_content = ''; - $files_field_content = ''; - $liens_field_content = ''; - $numero_field_content = ''; - $adresse_field_content = ''; - $lettre_field_content = ''; - $image_caption_field_content = ''; - - foreach ($variables['content'] as $field_name => $field_content) { - if ($field_name == 'body') { - $body_field_content = $field_content; - } elseif ($field_name == 'field_fichiers') { - $files_field_content = $field_content; - } elseif ($field_name == 'field_liens') { - $liens_field_content = $field_content; - } elseif ($field_name == 'field_adresse_site') { - $numero_field_content = $field_content; - } elseif ($field_name == 'field_numero_site') { - $adresse_field_content = $field_content; - } elseif ($field_name == 'field_lettre_de_site') { - $adresse_field_content = $field_content; - } elseif ($field_name == 'image_field_caption') { - $image_caption_field_content = $field_content; - } elseif (!in_array($field_name, $fields_to_exclude)) { - $filtered_content[$field_name] = $field_content; - } else { - $image_field_content = $field_content; - } - } - - $variables['filtered_content'] = $filtered_content; - $variables['image_field_content'] = $image_field_content; - $variables['body_field_content'] = $body_field_content; - $variables['files_field_content'] = $files_field_content; - $variables['liens_field_content'] = $liens_field_content; - $variables['adresse_field_content'] = $adresse_field_content; - $variables['numero_field_content'] = $numero_field_content; - $variables['field_lettre_de_site'] = $lettre_field_content; - $variables['image_field_caption'] = $image_caption_field_content; - } - } +function reha_preprocess_node(&$variables) { + $node = &$variables['node']; + $variables['attributes']['class'][] = 'node-type-' . $node->gettype(); + + if ($node->getType() == 'site' || $node->getType() == 'ressource' || $node->getType() == 'actualite') { + $fields_to_exclude = [ + 'field_image', // Remplacez par le nom machine exact de votre champ image + ]; + + $filtered_content = []; + $image_field_content = ''; + $body_field_content = ''; + $files_field_content = ''; + $liens_field_content = ''; + $numero_field_content = ''; + $adresse_field_content = ''; + $lettre_field_content = ''; + $image_caption_field_content = ''; + + foreach ($variables['content'] as $field_name => $field_content) { + if ($field_name == 'body') { + $body_field_content = $field_content; + } elseif ($field_name == 'field_fichiers') { + $files_field_content = $field_content; + } elseif ($field_name == 'field_liens') { + $liens_field_content = $field_content; + } elseif ($field_name == 'field_adresse_site') { + $numero_field_content = $field_content; + } elseif ($field_name == 'field_numero_site') { + $adresse_field_content = $field_content; + } elseif ($field_name == 'field_lettre_de_site') { + $adresse_field_content = $field_content; + } elseif ($field_name == 'image_field_caption') { + $image_caption_field_content = $field_content; + } elseif (!in_array($field_name, $fields_to_exclude)) { + $filtered_content[$field_name] = $field_content; + } else { + $image_field_content = $field_content; + } + } + + + $variables['filtered_content'] = $filtered_content; + $variables['image_field_content'] = $image_field_content; + $variables['body_field_content'] = $body_field_content; + $variables['files_field_content'] = $files_field_content; + $variables['liens_field_content'] = $liens_field_content; + $variables['adresse_field_content'] = $adresse_field_content; + $variables['numero_field_content'] = $numero_field_content; + $variables['field_lettre_de_site'] = $lettre_field_content; + $variables['image_field_caption'] = $image_caption_field_content; + } + + +} function reha_preprocess_block(&$variables) { @@ -90,7 +95,6 @@ function reha_preprocess_block(&$variables) { $block_id = 'block-' . uniqid(); $variables['attributes']['id'] = $block_id; } - if ($variables['plugin_id'] === "user_login_block") { $url = new Url('user.register', [], ['query' => ['destination' => '/node/add/operation']]); $link = new Link('proposer une opération', $url); @@ -117,8 +121,6 @@ function reha_preprocess_block(&$variables) { } } } - - if ($variables['plugin_id'] === "views_block:current_user_block-block_1") { $user = User::load($variables['user']->id()); $prenomnom = $user->get('field_prenom')->getString() . ' ' . $user->get('field_nom')->getString(); @@ -126,7 +128,6 @@ function reha_preprocess_block(&$variables) { $variables['label']['#markup'] = $prenomnom; } - } function reha_preprocess_field(&$variables){ @@ -145,4 +146,5 @@ function reha_preprocess_field(&$variables){ array_splice($variables['items'], 1); } } -} \ No newline at end of file +} + diff --git a/web/themes/custom/reha/scss/global/variables/_buttons.scss b/web/themes/custom/reha/scss/global/variables/_buttons.scss index 086f8dd..a67b3bc 100644 --- a/web/themes/custom/reha/scss/global/variables/_buttons.scss +++ b/web/themes/custom/reha/scss/global/variables/_buttons.scss @@ -47,6 +47,7 @@ @extend %buttonwithborder; } + .links{ @extend %buttonwithborder; } diff --git a/web/themes/custom/reha/scss/pages/node-site.scss b/web/themes/custom/reha/scss/pages/node-site.scss index 9a4b99c..9eaed8a 100644 --- a/web/themes/custom/reha/scss/pages/node-site.scss +++ b/web/themes/custom/reha/scss/pages/node-site.scss @@ -8,16 +8,19 @@ } } .region-content{ - - width: 80%; - margin: auto; - display: flex; - flex-direction: column; + display: grid; + // width: 80%; + // margin: auto; + // display: flex; + // flex-direction: column; + grid-template-columns: repeat(8 1fr); + grid-template-rows: repeat(3 auto); #block-reha-prevnextblock{ display: flex; flex-direction: row; - width: 1274px; + width: 70%; + grid-column: 1 /span 8; grid-row: 1; z-index: 97; height: fit-content; @@ -51,6 +54,8 @@ #block-reha-contenudelapageprincipale{ padding-top: 2rem; padding-bottom: 3rem; + grid-column: 1 /span 8; + grid-row: 2; .node-type-site{ margin: auto; display: flex; @@ -58,7 +63,7 @@ .entete_site{ background-color: white; height: 520px; - width: 1274px; + width: 70%; display: flex; flex-direction: row; margin: auto; @@ -216,28 +221,37 @@ // top: -60px; padding-top: 6rem; position: relative; - width: 50%; + width: 70%; margin: auto; font-size: 1.3rem; + display: flex; + flex-direction: row-reverse; + justify-content: space-between; + .summary-content{ + width: 75%; + } + .links-content{ + width: 15%; + margin-top: 1.5rem; + .field--type-file{ + border: none; + margin-bottom: 1rem; + background-color: transparent; + } + .field__item{ + padding: 0.3rem; + border: solid black 1px; + margin-bottom: 1rem; + background-color: rgb(255, 255, 255); + font-size: 0.9rem; + >*{ + text-transform: uppercase; + } + } + } } } } - #block-reha-config-pages-3{ - width: 15vw; - .field--name-field-fichier{ - border: none; - margin-bottom: 1rem; - background-color: transparent; - .field__item{ - text-transform: uppercase; - padding: 0.3rem; - border: solid black 1px; - margin-bottom: 1rem; - background-color: rgb(255, 255, 255); - font-size: 0.9rem; - } - } - } } } \ No newline at end of file diff --git a/web/themes/custom/reha/templates/block--config-pages--fiche-de-synthese-de-tous-les-si.html.twig b/web/themes/custom/reha/templates/block--config-pages--fiche-de-synthese-de-tous-les-si.html.twig new file mode 100644 index 0000000..6863546 --- /dev/null +++ b/web/themes/custom/reha/templates/block--config-pages--fiche-de-synthese-de-tous-les-si.html.twig @@ -0,0 +1,48 @@ +{# +/** + * @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, + 'block-reha-config-pages-3', + ] +%} + + {{ 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 f1b86ac..d754fcb 100644 --- a/web/themes/custom/reha/templates/node--site.html.twig +++ b/web/themes/custom/reha/templates/node--site.html.twig @@ -68,31 +68,7 @@ * @ingroup themeable */ #} -{# - {{ title_prefix }} - {% if label and not page %} - - {{ label }} - - {% endif %} - {{ title_suffix }} - - {% if display_submitted %} -
- {{ author_picture }} - - {% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %} - {{ metadata }} - -
- {% endif %} - - - {{ content }} - - - #} {{ title_prefix }} @@ -134,6 +110,7 @@ {{ liens_field_content }} {% endif %} + {% endif %} {{ title_suffix }}