actualites

This commit is contained in:
2024-06-21 16:04:48 +02:00
parent f203b873e4
commit 7b93e0576c
9 changed files with 77 additions and 9 deletions
+1 -1
View File
@@ -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('salut slick home');\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\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?");
/***/ }),
+10 -5
View File
@@ -227,10 +227,6 @@ main {
margin-top: 7rem;
}
#block-reha-titredepage {
display: none;
}
p {
background-color: transparent;
}
@@ -969,7 +965,7 @@ input {
font-family: "slick";
font-size: 200px;
line-height: 1;
color: #fdc300;
color: rgb(153, 147, 174);
opacity: 0.75;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@@ -1169,6 +1165,12 @@ input {
bottom: -40px !important;
}
.view-actus.slick-slider.slick-next:before {
content: ">";
font-weight: 100;
background: rgba(255, 255, 255, 0.1);
}
/*pages*/
.home-page-layout-content {
width: 100%;
@@ -2253,6 +2255,9 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div
width: fit-content;
padding: 0.2rem 0.9rem;
}
.page-actualites .view-actus .views-row .node-type-actualite .infos-content .field--name-field-site div:nth-child(1) {
display: none;
}
.page-actualites .view-actus .views-row .node-type-actualite .infos-content .field--name-field-site .field__item {
display: inline;
}
+1 -1
View File
@@ -127,7 +127,7 @@ jQuery(document).ready(function($){
}
}]
});
console.log('salut slick home');
console.log('slick actu');
});
+46
View File
@@ -4,6 +4,7 @@
use Drupal\Core\Url;
use Drupal\Core\Link;
use Drupal\Core\Render\Markup;
use Drupal\Component\Utility\Html;
/**
@@ -63,6 +64,28 @@ function reha_preprocess_html(&$variables) {
$variables['files_field_content'] = $files_field_content;
$variables['liens_field_content'] = $liens_field_content;
}
// if ($node->getType() == 'site') {
// $blocks_to_exclude = [
// 'block-entity-fieldnodefield-image',
// ];
// $filtered_block_content = [];
// $image_block_content = '';
// foreach ($variables['content'] as $block_name => $field_content) {
// if (!in_array($block_name, $blocks_to_exclude)) {
// $filtered_block_content[$block_name] = $field_content;
// } else {
// $image_block_content = $field_content;
// }
// }
// // Set variables for the template
// $variables['filtered_block_content'] = $filtered_block_content;
// $variables['image_block_content'] = $image_block_content;
// }
}
/**
@@ -137,6 +160,13 @@ function reha_preprocess_page(&$variables) {
//https://www.hashbangcode.com/article/drupal-9-programmatically-creating-and-using-urls-and-links
function reha_preprocess_block(&$variables) {
// // Conserver les IDs existants et générer un ID unique uniquement si aucun ID n'est présent
// if (empty($variables['attributes']['id'])) {
// $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);
@@ -162,6 +192,22 @@ function reha_preprocess_block(&$variables) {
];
}
}
// // Extraction du texte du <h2> et transformation en ID
// if (isset($variables['content']['#contextual_links']['block']['h2'])) {
// $h2_text = $variables['content']['#contextual_links']['block']['h2'];
// $block_id = Html::cleanCssIdentifier($h2_text);
// $variables['attributes']['id'] = $block_id;
// } elseif (isset($variables['content']['#block_content']['body']['0']['#text'])) {
// $h2_text = $variables['content']['#block_content']['body']['0']['#text'];
// $block_id = Html::cleanCssIdentifier(strip_tags($h2_text));
// $variables['attributes']['id'] = $block_id;
// } else {
// // Fallback ID if no <h2> is found
// $block_id = Html::cleanCssIdentifier($variables['plugin_id']);
// $variables['attributes']['id'] = $block_id;
// }
}
// if ($variables['plugin_id'] == 'actus-block-1') {
// $fields_to_exclude = [
@@ -84,7 +84,7 @@ main{
}
#block-reha-titredepage{
display: none;
// display: none;
}
p{
@@ -54,6 +54,10 @@
border-radius: 50px;
width: fit-content;
padding: 0.2rem 0.9rem;
div:nth-child(1)
{
display: none;
}
.field__item{
display: inline;
}
@@ -10,7 +10,7 @@
$slick-font-path: "./fonts/" !default;
$slick-font-family: "slick" !default;
$slick-loader-path: "./" !default;
$slick-arrow-color: $yellow-puca !default;
$slick-arrow-color: $gris-violet !default;
$slick-dot-color: black !default;
$slick-dot-color-active: $slick-dot-color !default;
$slick-prev-character: "\003C" !default;
@@ -1,4 +1,9 @@
$slick-prev-character: "\003C" !default;
$slick-next-character: "\003E" !default;
$slick-arrow-color: $yellow-puca !default;
.home-page-layout-content{
.slick-dots {
@@ -6,3 +11,10 @@
}
}
.view-actus.slick-slider.slick-next {
&:before {
content: $slick-next-character;
font-weight: 100;
background: rgba(255, 255, 255, 0.1);
}
}
@@ -53,6 +53,7 @@
]
%}
{% if label_hidden %}
{% if multiple %}
<div{{ attributes.addClass(classes, 'field__items') }}>