Quellcode durchsuchen

home presentation, page site

ouidade vor 4 Monaten
Ursprung
Commit
3353e208b1

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
web/themes/custom/reha/dist/bundle.js


+ 69 - 9
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 .image-site .field--name-field-image {
+  width: 80%;
+  margin: auto;
 }
-.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 .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;

+ 26 - 1
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);
 

+ 20 - 17
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();
-
-      // 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);
-  }
-}
+// 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);
+//   }
+
+// }
+
+
 
 
 // /**

+ 33 - 9
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');
+                }
+            }
         }
-        
     }
 }

+ 5 - 1
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;
     }
 }

+ 1 - 0
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;

+ 59 - 14
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;

+ 18 - 33
web/themes/custom/reha/templates/block--views-block--actus-block-1.html.twig → web/themes/custom/reha/templates/__block--views-block--home-block-1.html.twig

@@ -35,24 +35,6 @@
     'block-' ~ plugin_id|clean_class,
   ]
 %}
-<div{{ attributes.addClass(classes) }}>
-  {{ title_prefix }}
-  {% if label %}
-    <h2{{ title_attributes }}>{{ label }}</h2>
-  {% endif %}
-  {{ title_suffix }}
-  {% block content %}
-    {{ content }}
-  {% endblock %}
-</div>
-
-{# {%
-  set classes = [
-    'block',
-    'block-' ~ configuration.provider|clean_class,
-    'block-' ~ plugin_id|clean_class,
-  ]
-%}
 <div{{ attributes.addClass(classes) }}>
   {{ title_prefix }}
   {% if label %}
@@ -60,19 +42,22 @@
   {% endif %}
   {{ title_suffix }}
 
-  {% block content %}
-    {# Afficher le contenu exclu séparément #}
-    {# {% if excluded_field_content %}
-      <div class="excluded-field-content">
-        {{ excluded_field_content }}
-      </div>
-    {% endif %}
-
-    {# Afficher le contenu filtré #}
-    {# <div class="filtered-content">
-      {% for field_name, field_content in filtered_content %}
-        {{ field_content }}
+  <div class="custom-block-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('</p>') %}
+          {# Display the first paragraph only #}
+          <p>{{ paragraphs[0]|striptags }}</p>
+          {# Add a "Voir plus" button that links to the full content page #}
+          <a href="/full-content-page" class="btn btn-primary">Voir plus</a>
+          {% set displayed_first_paragraph = true %}
+        {% elseif not displayed_first_paragraph %}
+          {{ item }}
+        {% endif %}
       {% endfor %}
-    </div>
-  {% endblock %}
-</div> #} 
+    {% endif %}
+  </div>
+</div>

+ 59 - 0
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
+ */
+#}
+<p class="address" translate="no">
+  {% if given_name or family_name %}
+  <span class="">  {{ given_name }} {{ family_name }} </span><br>
+  {% endif %}
+  {% if organization %}
+    <span class="">{{ organization }}</span><br>
+  {% endif %}
+  {% if address_line1 %}
+   <span class=""> {{ address_line1 }} </span><br>
+  {% endif %}
+  {% if address_line2 %}
+    <span class="">{{ address_line2 }} </span><br>
+  {% endif %}
+  {% if dependent_locality.code %}
+   <span class="locality"> {{ dependent_locality.code }} </span><br>
+  {% endif %}
+  {% if locality.code or postal_code or administrative_area.code %}
+   <span class="postal-code"> {{ locality.code }} {{ postal_code }} {{ administrative_area.code }} </span><br>
+  {% endif %}
+  <span class="country">{{ country.name }}</span>
+</p>

+ 0 - 47
web/themes/custom/reha/templates/block--views-block--sites-block-1.html.twig

@@ -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,
-  ]
-%}
-<div{{ attributes.addClass(classes) }}>
-  {{ title_prefix }}
-  {% if label %}
-    <h2{{ title_attributes }}>{{ label }}</h2>
-  {% endif %}
-  {{ title_suffix }}
-  {% block content %}
-    {{ content }}
-  {% endblock %}
-</div>

+ 1 - 0
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 #}
   <div class="filtered-content">
+  <h1>{{ node.label }}</h1>
     {% if label and not page %}
       <h2{{ title_attributes }}>
         <a href="{{ url }}" rel="bookmark">{{ label }}</a>

+ 1 - 1
web/themes/custom/reha/templates/page--home.html.twig

@@ -45,7 +45,7 @@
  * @ingroup themeable
  */
 #}
-<div class="layout-container">
+<div class="layout-container page--home">
 
   <header role="banner">
     {{ page.header }}

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.