diff --git a/web/themes/custom/reha/dist/bundle.js b/web/themes/custom/reha/dist/bundle.js index 28c051b..a0ae6ae 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 // $(\".profile--type--collaborateur\").click(function(event) {\n // // Ouvrir .tiroir fichiers\n // $(\".layout-sidebar-second\").animate({translate:'90%'},350);\n // });\n // $(\"#block-reha-views-block-current-user-doc-profile-block-1 > h2\").click(function(event) {\n // // Ouvrir .tiroir fichiers\n // $(\".layout-sidebar-second\").animate({translate:'0%'},350);\n // });\n $(document).ready(function() {\n // Vérifier l'état initial depuis sessionStorage\n if (sessionStorage.getItem('asideOpened') === 'true') {\n $(\".layout-sidebar-second\").addClass('open');\n }\n\n $(\".profile--type--collaborateur\").click(function(event) {\n // Ouvrir .tiroir fichiers\n $(\".layout-sidebar-second\").addClass('open');\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('open');\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 $(document).ready(function(){\n $('.page-node-site .node-type-site .field--name-field-image > div:nth-child(2)').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 actu');\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 // $(\".profile--type--collaborateur\").click(function(event) {\n // // Ouvrir .tiroir fichiers\n // $(\".layout-sidebar-second\").animate({translate:'90%'},350);\n // });\n // $(\"#block-reha-views-block-current-user-doc-profile-block-1 > h2\").click(function(event) {\n // // Ouvrir .tiroir fichiers\n // $(\".layout-sidebar-second\").animate({translate:'0%'},350);\n // });\n $(document).ready(function() {\n // Vérifier l'état initial depuis sessionStorage\n if (sessionStorage.getItem('asideOpened') === 'true') {\n $(\".layout-sidebar-second\").addClass('open');\n }\n\n $(\".profile--type--collaborateur\").click(function(event) {\n // Ouvrir .tiroir fichiers\n $(\".layout-sidebar-second\").addClass('open');\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('open');\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 $(document).ready(function(){\n $('.page-node-site .node-type-site .field--name-field-image > div:nth-child(2)').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 actu');\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-region-first'),\n// fixedElementHeight = 500;\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\n\n})(jQuery, window);\n\n\n\n//# sourceURL=webpack://dev.reha.fr/./js/reha.js?"); /***/ }), diff --git a/web/themes/custom/reha/js/reha.js b/web/themes/custom/reha/js/reha.js index 842b6a8..dd18f58 100644 --- a/web/themes/custom/reha/js/reha.js +++ b/web/themes/custom/reha/js/reha.js @@ -185,5 +185,26 @@ jQuery(document).ready(function($){ }); + + +// ///////////////// +//// ancre dans texte au click parragraphe correspondant arrive en dessous du header + + +// (function($, window) { +// var adjustAnchor = function() { +// var $anchor = $('.block-region-first'), +// fixedElementHeight = 500; +// if ($anchor.length > 0) { +// $('html, body').stop().animate({scrollTop: $anchor.offset().top - fixedElementHeight }, 0); +// } +// }; + +// $(window).on('hashchange', function() { +// adjustAnchor(); +// }); +// }); + + })(jQuery, window); diff --git a/web/themes/custom/reha/templates/__block--views-block--home-block-1.html.twig b/web/themes/custom/reha/templates/block--config-pages--partenaires--full.html.twig similarity index 63% rename from web/themes/custom/reha/templates/__block--views-block--home-block-1.html.twig rename to web/themes/custom/reha/templates/block--config-pages--partenaires--full.html.twig index b8b0a1c..70830b3 100644 --- a/web/themes/custom/reha/templates/__block--views-block--home-block-1.html.twig +++ b/web/themes/custom/reha/templates/block--config-pages--partenaires--full.html.twig @@ -35,29 +35,13 @@ 'block-' ~ plugin_id|clean_class, ] %} - + {{ title_prefix }} {% if label %} - {{ label }} +

{{ label }}

{% endif %} {{ title_suffix }} - -
- {% 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 %} - {% endif %} -
+ {% block content %} + {{ content }} + {% endblock %} diff --git a/web/themes/custom/reha/templates/block--views-block--home-block-1.html.twig b/web/themes/custom/reha/templates/block--views-block--home-block-1.html.twig new file mode 100644 index 0000000..021b693 --- /dev/null +++ b/web/themes/custom/reha/templates/block--views-block--home-block-1.html.twig @@ -0,0 +1,47 @@ +{# +/** + * @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 %} +