Browse Source

Merge branch 'master' of figureslibres.io:bachir/popsu-d9

armansansd 3 years ago
parent
commit
446490ca3f

+ 2 - 0
config/sync/core.entity_view_display.node.programme.default.yml

@@ -97,6 +97,8 @@ content:
     settings: {  }
     third_party_settings: {  }
 hidden:
+  computed_projets_reference: true
+  computed_themes_reference: true
   field_actif: true
   field_poid: true
   langcode: true

+ 6 - 30
config/sync/core.entity_view_display.paragraph.textes.preview.yml

@@ -8,44 +8,20 @@ dependencies:
     - field.field.paragraph.textes.field_texte
     - field.field.paragraph.textes.field_titre
     - paragraphs.paragraphs_type.textes
-  module:
-    - advanced_text_formatter
 id: paragraph.textes.preview
 targetEntityType: paragraph
 bundle: textes
 mode: preview
 content:
-  field_texte:
+  field_titre:
+    type: string
     weight: 0
-    label: hidden
+    region: content
+    label: visually_hidden
     settings:
-      trim_length: '600'
-      ellipsis: '1'
-      word_boundary: '1'
-      use_summary: '1'
-      filter: input
-      format: plain_text
-      allowed_html:
-        - a
-        - b
-        - br
-        - dd
-        - dl
-        - dt
-        - em
-        - i
-        - li
-        - ol
-        - p
-        - strong
-        - u
-        - ul
-      token_replace: 0
-      autop: 0
+      link_to_entity: false
     third_party_settings: {  }
-    type: advanced_text
-    region: content
 hidden:
   field_photo: true
-  field_titre: true
+  field_texte: true
   search_api_excerpt: true

+ 1 - 0
config/sync/core.extension.yml

@@ -112,6 +112,7 @@ module:
   persistent_login: 0
   popsu_link_block: 0
   popsu_migrate: 0
+  popsu_programme: 0
   redirect: 0
   redis: 0
   responsive_image: 0

+ 13 - 0
config/sync/page_manager.page_variant.node-panels_variant-1.yml

@@ -4,10 +4,12 @@ status: true
 dependencies:
   config:
     - page_manager.page.node
+    - views.view.static
   module:
     - ctools
     - ctools_block
     - panels
+    - views
 id: node-panels_variant-1
 label: Static
 variant: panels_variant
@@ -80,6 +82,17 @@ variant_settings:
       uuid: 1a8fe5ae-455a-4235-8568-487d91f75cf8
       context_mapping:
         entity: node
+    8b03ade6-e854-4bb0-8a9b-34722a2854a3:
+      id: 'views_block:static-block_1'
+      label: ''
+      provider: views
+      label_display: '0'
+      views_label: ''
+      items_per_page: none
+      region: first
+      weight: 0
+      uuid: 8b03ade6-e854-4bb0-8a9b-34722a2854a3
+      context_mapping: {  }
   id: panels_variant
   uuid: 0270b847-8f4c-4875-9783-3fcc27841d13
   label: null

+ 15 - 19
config/sync/page_manager.page_variant.node-panels_variant-4.yml

@@ -44,7 +44,7 @@ variant_settings:
         third_party_settings: {  }
         weight: 0
       region: third
-      weight: -1
+      weight: -8
       uuid: fa5671b0-2af1-45de-8eae-3aa8bcc1be7d
       context_mapping:
         entity: node
@@ -61,7 +61,7 @@ variant_settings:
         third_party_settings: {  }
         weight: 0
       region: third
-      weight: -2
+      weight: -9
       uuid: 8366d015-1ffd-4252-b8d3-fbeef9c0cd8d
       context_mapping:
         entity: node
@@ -112,8 +112,8 @@ variant_settings:
           link: true
         third_party_settings: {  }
         weight: 0
-      region: third
-      weight: 0
+      region: second
+      weight: 1
       uuid: dc51d922-4083-40a8-9790-12c389b44e80
       context_mapping:
         entity: node
@@ -129,8 +129,8 @@ variant_settings:
           view_mode: default
         third_party_settings: {  }
         weight: 0
-      region: third
-      weight: -4
+      region: second
+      weight: -1
       uuid: 4a9634d1-b1a3-48c3-869b-487350961e1f
       context_mapping:
         entity: node
@@ -163,8 +163,8 @@ variant_settings:
           link: true
         third_party_settings: {  }
         weight: 0
-      region: third
-      weight: 1
+      region: second
+      weight: 2
       uuid: 8e359f44-255d-4349-a740-8e9db75ebced
       context_mapping:
         entity: node
@@ -197,8 +197,8 @@ variant_settings:
           link: true
         third_party_settings: {  }
         weight: 0
-      region: third
-      weight: -3
+      region: second
+      weight: 0
       uuid: 0d7b12da-76c6-471b-ab53-0e57b520915e
       context_mapping:
         entity: node
@@ -214,8 +214,8 @@ variant_settings:
           view_mode: default
         third_party_settings: {  }
         weight: 0
-      region: third
-      weight: -5
+      region: second
+      weight: -2
       uuid: 80ceb299-5738-410f-8448-79f438df51e7
       context_mapping:
         entity: node
@@ -229,7 +229,8 @@ variant_settings:
       region: first
       weight: -5
       uuid: 9879675e-0278-482d-9ae0-bdffb5241640
-      context_mapping: {  }
+      context_mapping:
+        field_programme_target_id: node
   id: panels_variant
   uuid: 905f0d96-a78c-40f1-bb80-f259e145444f
   label: null
@@ -252,9 +253,4 @@ selection_criteria:
     context_mapping:
       node: node
 selection_logic: and
-static_context:
-  programme:
-    label: programme
-    type: 'entity_revision:node'
-    description: ''
-    value: 'node:field_programme'
+static_context: {  }

+ 3 - 68
config/sync/views.view.evenements.yml

@@ -4,13 +4,11 @@ status: true
 dependencies:
   config:
     - field.storage.node.field_date
-    - field.storage.node.field_intro
     - field.storage.node.field_sous_titre
     - node.type.evenement
   module:
     - datetime
     - node
-    - text
     - user
 id: evenements
 label: 'Prog Événements'
@@ -251,68 +249,6 @@ display:
           separator: ', '
           field_api_classes: false
           plugin_id: field
-        field_intro:
-          id: field_intro
-          table: node__field_intro
-          field: field_intro
-          relationship: none
-          group_type: group
-          admin_label: ''
-          label: ''
-          exclude: false
-          alter:
-            alter_text: false
-            text: ''
-            make_link: false
-            path: ''
-            absolute: false
-            external: false
-            replace_spaces: false
-            path_case: none
-            trim_whitespace: false
-            alt: ''
-            rel: ''
-            link_class: ''
-            prefix: ''
-            suffix: ''
-            target: ''
-            nl2br: false
-            max_length: 0
-            word_boundary: true
-            ellipsis: true
-            more_link: false
-            more_link_text: ''
-            more_link_path: ''
-            strip_tags: false
-            trim: false
-            preserve_tags: ''
-            html: false
-          element_type: ''
-          element_class: ''
-          element_label_type: ''
-          element_label_class: ''
-          element_label_colon: false
-          element_wrapper_type: ''
-          element_wrapper_class: ''
-          element_default_classes: true
-          empty: ''
-          hide_empty: false
-          empty_zero: false
-          hide_alter_empty: true
-          click_sort_column: value
-          type: text_default
-          settings: {  }
-          group_column: value
-          group_columns: {  }
-          group_rows: true
-          delta_limit: 0
-          delta_offset: 0
-          delta_reversed: false
-          delta_first_last: false
-          multi_type: separator
-          separator: ', '
-          field_api_classes: false
-          plugin_id: field
       filters:
         status:
           value: '1'
@@ -355,7 +291,7 @@ display:
           expose:
             label: ''
           granularity: second
-      title: 'Événements associée'
+      title: 'Événements associés'
       header: {  }
       footer: {  }
       empty: {  }
@@ -395,7 +331,8 @@ display:
           break_phrase: false
           not: false
           plugin_id: numeric
-      display_extenders: {  }
+      display_extenders:
+        views_ef_fieldset: {  }
     cache_metadata:
       max-age: -1
       contexts:
@@ -406,7 +343,6 @@ display:
         - user.permissions
       tags:
         - 'config:field.storage.node.field_date'
-        - 'config:field.storage.node.field_intro'
         - 'config:field.storage.node.field_sous_titre'
   block_1:
     display_plugin: block
@@ -427,5 +363,4 @@ display:
         - user.permissions
       tags:
         - 'config:field.storage.node.field_date'
-        - 'config:field.storage.node.field_intro'
         - 'config:field.storage.node.field_sous_titre'

+ 196 - 23
config/sync/views.view.programme_toc.yml

@@ -3,11 +3,13 @@ langcode: fr
 status: true
 dependencies:
   config:
-    - core.entity_view_mode.node.teaser
+    - field.storage.node.field_image
     - field.storage.node.field_logo
+    - field.storage.node.field_programme
     - field.storage.node.field_themes_lies
     - field.storage.node.field_ville
     - image.style.medium
+    - image.style.very_large
     - node.type.actualite
     - node.type.evenement
     - node.type.programme
@@ -469,6 +471,8 @@ display:
         filters: false
         filter_groups: false
         fields: false
+        arguments: false
+        relationships: false
       header:
         result:
           id: result
@@ -667,6 +671,55 @@ display:
           separator: ', '
           field_api_classes: false
           plugin_id: field
+      arguments:
+        field_programme_target_id:
+          id: field_programme_target_id
+          table: node__field_programme
+          field: field_programme_target_id
+          relationship: none
+          group_type: group
+          admin_label: ''
+          default_action: default
+          exception:
+            value: all
+            title_enable: false
+            title: All
+          title_enable: false
+          title: ''
+          default_argument_type: node
+          default_argument_options: {  }
+          default_argument_skip_url: false
+          summary_options:
+            base_path: ''
+            count: true
+            items_per_page: 25
+            override: false
+          summary:
+            sort_order: asc
+            number_of_records: 0
+            format: default_summary
+          specify_validation: true
+          validate:
+            type: 'entity:node'
+            fail: 'not found'
+          validate_options:
+            bundles:
+              programme: programme
+            operation: view
+            multiple: 0
+            access: false
+          break_phrase: false
+          not: false
+          plugin_id: numeric
+      allow:
+        items_per_page: true
+        configure_sorts: configure_sorts
+        offset: '0'
+        pager: '0'
+        hide_fields: '0'
+        sort_fields: '0'
+        disable_filters: '0'
+      relationships: {  }
     cache_metadata:
       max-age: -1
       contexts:
@@ -852,15 +905,78 @@ display:
           1: AND
           2: OR
       fields:
-        field_ville:
-          id: field_ville
-          table: node__field_ville
-          field: field_ville
+        title:
+          id: title
+          table: node_field_data
+          field: title
           relationship: none
           group_type: group
           admin_label: ''
           label: ''
-          exclude: true
+          exclude: false
+          alter:
+            alter_text: true
+            text: '{{ field_ville }}'
+            make_link: false
+            path: ''
+            absolute: false
+            external: false
+            replace_spaces: false
+            path_case: none
+            trim_whitespace: false
+            alt: ''
+            rel: ''
+            link_class: ''
+            prefix: ''
+            suffix: ''
+            target: ''
+            nl2br: false
+            max_length: 0
+            word_boundary: true
+            ellipsis: true
+            more_link: false
+            more_link_text: ''
+            more_link_path: ''
+            strip_tags: false
+            trim: false
+            preserve_tags: ''
+            html: false
+          element_type: ''
+          element_class: ''
+          element_label_type: ''
+          element_label_class: ''
+          element_label_colon: false
+          element_wrapper_type: ''
+          element_wrapper_class: ''
+          element_default_classes: true
+          empty: ''
+          hide_empty: false
+          empty_zero: false
+          hide_alter_empty: true
+          click_sort_column: value
+          type: string
+          settings:
+            link_to_entity: true
+          group_column: value
+          group_columns: {  }
+          group_rows: true
+          delta_limit: 0
+          delta_offset: 0
+          delta_reversed: false
+          delta_first_last: false
+          multi_type: separator
+          separator: ', '
+          field_api_classes: false
+          plugin_id: field
+        field_image:
+          id: field_image
+          table: node__field_image
+          field: field_image
+          relationship: none
+          group_type: group
+          admin_label: ''
+          label: ''
+          exclude: false
           alter:
             alter_text: false
             text: ''
@@ -901,10 +1017,11 @@ display:
           empty_zero: false
           hide_alter_empty: true
           click_sort_column: target_id
-          type: entity_reference_label
+          type: image
           settings:
-            link: false
-          group_column: target_id
+            image_style: very_large
+            image_link: content
+          group_column: ''
           group_columns: {  }
           group_rows: true
           delta_limit: 0
@@ -915,18 +1032,18 @@ display:
           separator: ', '
           field_api_classes: false
           plugin_id: field
-        title:
-          id: title
-          table: node_field_data
-          field: title
+        view_node:
+          id: view_node
+          table: node
+          field: view_node
           relationship: none
           group_type: group
           admin_label: ''
           label: ''
           exclude: false
           alter:
-            alter_text: true
-            text: '{{ field_ville }}'
+            alter_text: false
+            text: ''
             make_link: false
             path: ''
             absolute: false
@@ -963,11 +1080,64 @@ display:
           hide_empty: false
           empty_zero: false
           hide_alter_empty: true
-          click_sort_column: value
-          type: string
+          text: voir
+          output_url_as_text: false
+          absolute: false
+          entity_type: node
+          plugin_id: entity_link
+        field_programme:
+          id: field_programme
+          table: node__field_programme
+          field: field_programme
+          relationship: none
+          group_type: group
+          admin_label: ''
+          label: ''
+          exclude: false
+          alter:
+            alter_text: false
+            text: ''
+            make_link: false
+            path: ''
+            absolute: false
+            external: false
+            replace_spaces: false
+            path_case: none
+            trim_whitespace: false
+            alt: ''
+            rel: ''
+            link_class: ''
+            prefix: ''
+            suffix: ''
+            target: ''
+            nl2br: false
+            max_length: 0
+            word_boundary: true
+            ellipsis: true
+            more_link: false
+            more_link_text: ''
+            more_link_path: ''
+            strip_tags: false
+            trim: false
+            preserve_tags: ''
+            html: false
+          element_type: ''
+          element_class: ''
+          element_label_type: ''
+          element_label_class: ''
+          element_label_colon: false
+          element_wrapper_type: ''
+          element_wrapper_class: ''
+          element_default_classes: true
+          empty: ''
+          hide_empty: false
+          empty_zero: false
+          hide_alter_empty: true
+          click_sort_column: target_id
+          type: entity_reference_label
           settings:
-            link_to_entity: true
-          group_column: value
+            link: true
+          group_column: target_id
           group_columns: {  }
           group_rows: true
           delta_limit: 0
@@ -982,10 +1152,12 @@ display:
         type: default
         options: {  }
       row:
-        type: 'entity:node'
+        type: fields
         options:
-          relationship: none
-          view_mode: teaser
+          default_field_elements: true
+          inline: {  }
+          separator: ''
+          hide_empty: false
       pager:
         type: some
         options:
@@ -1030,7 +1202,8 @@ display:
         - 'user.node_grants:view'
         - user.permissions
       tags:
-        - 'config:field.storage.node.field_ville'
+        - 'config:field.storage.node.field_image'
+        - 'config:field.storage.node.field_programme'
   block_6:
     display_plugin: block
     id: block_6

+ 194 - 21
config/sync/views.view.programmes.yml

@@ -3,12 +3,13 @@ langcode: fr
 status: true
 dependencies:
   config:
-    - field.storage.node.field_diaporama
-    - image.style.medium
+    - field.storage.node.field_logo
+    - image.style.large
     - node.type.programme
   module:
     - image
     - node
+    - popsu_programme
     - user
 id: programmes
 label: Programmes
@@ -358,6 +359,9 @@ display:
         title: false
         header: false
         fields: false
+        relationships: false
+        filters: false
+        filter_groups: false
       block_category: 'home (Views)'
       header:
         result:
@@ -371,10 +375,10 @@ display:
           content: '@total programmes actifs'
           plugin_id: result
       fields:
-        title:
-          id: title
-          table: node_field_data
-          field: title
+        field_logo:
+          id: field_logo
+          table: node__field_logo
+          field: field_logo
           relationship: none
           group_type: group
           admin_label: ''
@@ -419,11 +423,12 @@ display:
           hide_empty: false
           empty_zero: false
           hide_alter_empty: true
-          click_sort_column: value
-          type: string
+          click_sort_column: target_id
+          type: image
           settings:
-            link_to_entity: true
-          group_column: value
+            image_style: large
+            image_link: content
+          group_column: ''
           group_columns: {  }
           group_rows: true
           delta_limit: 0
@@ -434,10 +439,10 @@ display:
           separator: ', '
           field_api_classes: false
           plugin_id: field
-        field_diaporama:
-          id: field_diaporama
-          table: node__field_diaporama
-          field: field_diaporama
+        title:
+          id: title
+          table: node_field_data
+          field: title
           relationship: none
           group_type: group
           admin_label: ''
@@ -482,15 +487,14 @@ display:
           hide_empty: false
           empty_zero: false
           hide_alter_empty: true
-          click_sort_column: target_id
-          type: image
+          click_sort_column: value
+          type: string
           settings:
-            image_style: medium
-            image_link: content
-          group_column: ''
+            link_to_entity: true
+          group_column: value
           group_columns: {  }
           group_rows: true
-          delta_limit: 1
+          delta_limit: 0
           delta_offset: 0
           delta_reversed: false
           delta_first_last: false
@@ -498,6 +502,175 @@ display:
           separator: ', '
           field_api_classes: false
           plugin_id: field
+        computed_projets_reference:
+          id: computed_projets_reference
+          table: node
+          field: computed_projets_reference
+          relationship: none
+          group_type: group
+          admin_label: ''
+          label: ''
+          exclude: false
+          alter:
+            alter_text: false
+            text: ''
+            make_link: false
+            path: ''
+            absolute: false
+            external: false
+            replace_spaces: false
+            path_case: none
+            trim_whitespace: false
+            alt: ''
+            rel: ''
+            link_class: ''
+            prefix: ''
+            suffix: ''
+            target: ''
+            nl2br: false
+            max_length: 0
+            word_boundary: true
+            ellipsis: true
+            more_link: false
+            more_link_text: ''
+            more_link_path: ''
+            strip_tags: false
+            trim: false
+            preserve_tags: ''
+            html: false
+          element_type: ''
+          element_class: ''
+          element_label_type: ''
+          element_label_class: ''
+          element_label_colon: false
+          element_wrapper_type: ''
+          element_wrapper_class: ''
+          element_default_classes: true
+          empty: ''
+          hide_empty: false
+          empty_zero: false
+          hide_alter_empty: true
+          entity_type: node
+          plugin_id: views_computed_projets_reference
+        computed_themes_reference:
+          id: computed_themes_reference
+          table: node
+          field: computed_themes_reference
+          relationship: none
+          group_type: group
+          admin_label: ''
+          label: ''
+          exclude: false
+          alter:
+            alter_text: false
+            text: ''
+            make_link: false
+            path: ''
+            absolute: false
+            external: false
+            replace_spaces: false
+            path_case: none
+            trim_whitespace: false
+            alt: ''
+            rel: ''
+            link_class: ''
+            prefix: ''
+            suffix: ''
+            target: ''
+            nl2br: false
+            max_length: 0
+            word_boundary: true
+            ellipsis: true
+            more_link: false
+            more_link_text: ''
+            more_link_path: ''
+            strip_tags: false
+            trim: false
+            preserve_tags: ''
+            html: false
+          element_type: ''
+          element_class: ''
+          element_label_type: ''
+          element_label_class: ''
+          element_label_colon: false
+          element_wrapper_type: ''
+          element_wrapper_class: ''
+          element_default_classes: true
+          empty: ''
+          hide_empty: false
+          empty_zero: false
+          hide_alter_empty: true
+          entity_type: node
+          plugin_id: views_computed_themes_reference
+      relationships: {  }
+      filters:
+        status:
+          value: '1'
+          table: node_field_data
+          field: status
+          plugin_id: boolean
+          entity_type: node
+          entity_field: status
+          id: status
+          expose:
+            operator: ''
+            operator_limit_selection: false
+            operator_list: {  }
+          group: 1
+        type:
+          id: type
+          table: node_field_data
+          field: type
+          value:
+            programme: programme
+          entity_type: node
+          entity_field: type
+          plugin_id: bundle
+          expose:
+            operator_limit_selection: false
+            operator_list: {  }
+        field_actif_value:
+          id: field_actif_value
+          table: node__field_actif
+          field: field_actif_value
+          relationship: none
+          group_type: group
+          admin_label: ''
+          operator: '='
+          value: '1'
+          group: 1
+          exposed: false
+          expose:
+            operator_id: ''
+            label: ''
+            description: ''
+            use_operator: false
+            operator: ''
+            operator_limit_selection: false
+            operator_list: {  }
+            identifier: ''
+            required: false
+            remember: false
+            multiple: false
+            remember_roles:
+              authenticated: authenticated
+          is_grouped: false
+          group_info:
+            label: ''
+            description: ''
+            identifier: ''
+            optional: true
+            widget: select
+            multiple: false
+            remember: false
+            default_group: All
+            default_group_multiple: {  }
+            group_items: {  }
+          plugin_id: boolean
+      filter_groups:
+        operator: AND
+        groups:
+          1: AND
     cache_metadata:
       max-age: -1
       contexts:
@@ -506,4 +679,4 @@ display:
         - 'user.node_grants:view'
         - user.permissions
       tags:
-        - 'config:field.storage.node.field_diaporama'
+        - 'config:field.storage.node.field_logo'

+ 246 - 0
config/sync/views.view.static.yml

@@ -0,0 +1,246 @@
+uuid: 87dd26fa-1296-4690-bdd2-54c33259064e
+langcode: fr
+status: true
+dependencies:
+  config:
+    - field.storage.node.field_textes
+    - node.type.static
+  module:
+    - entity_reference_revisions
+    - node
+    - user
+id: static
+label: static
+module: views
+description: ''
+tag: ''
+base_table: node_field_data
+base_field: nid
+display:
+  default:
+    display_plugin: default
+    id: default
+    display_title: Master
+    position: 0
+    display_options:
+      access:
+        type: perm
+        options:
+          perm: 'access content'
+      cache:
+        type: tag
+        options: {  }
+      query:
+        type: views_query
+        options:
+          disable_sql_rewrite: false
+          distinct: false
+          replica: false
+          query_comment: ''
+          query_tags: {  }
+      exposed_form:
+        type: basic
+        options:
+          submit_button: Apply
+          reset_button: false
+          reset_button_label: Reset
+          exposed_sorts_label: 'Sort by'
+          expose_sort_order: true
+          sort_asc_label: Asc
+          sort_desc_label: Desc
+      pager:
+        type: mini
+        options:
+          items_per_page: 10
+          offset: 0
+          id: 0
+          total_pages: null
+          expose:
+            items_per_page: false
+            items_per_page_label: 'Items per page'
+            items_per_page_options: '5, 10, 25, 50'
+            items_per_page_options_all: false
+            items_per_page_options_all_label: '- All -'
+            offset: false
+            offset_label: Offset
+          tags:
+            previous: ‹‹
+            next: ››
+      style:
+        type: default
+        options:
+          grouping: {  }
+          row_class: ''
+          default_row_class: true
+          uses_fields: false
+      row:
+        type: fields
+        options:
+          inline: {  }
+          separator: ''
+          hide_empty: false
+          default_field_elements: true
+      fields:
+        field_textes:
+          id: field_textes
+          table: node__field_textes
+          field: field_textes
+          relationship: none
+          group_type: group
+          admin_label: ''
+          label: ''
+          exclude: false
+          alter:
+            alter_text: false
+            text: ''
+            make_link: false
+            path: ''
+            absolute: false
+            external: false
+            replace_spaces: false
+            path_case: none
+            trim_whitespace: false
+            alt: ''
+            rel: ''
+            link_class: ''
+            prefix: ''
+            suffix: ''
+            target: ''
+            nl2br: false
+            max_length: 0
+            word_boundary: true
+            ellipsis: true
+            more_link: false
+            more_link_text: ''
+            more_link_path: ''
+            strip_tags: false
+            trim: false
+            preserve_tags: ''
+            html: false
+          element_type: ''
+          element_class: ''
+          element_label_type: ''
+          element_label_class: ''
+          element_label_colon: false
+          element_wrapper_type: ''
+          element_wrapper_class: ''
+          element_default_classes: true
+          empty: ''
+          hide_empty: false
+          empty_zero: false
+          hide_alter_empty: true
+          click_sort_column: target_id
+          type: entity_reference_revisions_entity_view
+          settings:
+            view_mode: preview
+          group_column: ''
+          group_columns: {  }
+          group_rows: true
+          delta_limit: 0
+          delta_offset: 0
+          delta_reversed: false
+          delta_first_last: false
+          multi_type: ul
+          separator: ', '
+          field_api_classes: false
+          plugin_id: field
+      filters:
+        status:
+          value: '1'
+          table: node_field_data
+          field: status
+          plugin_id: boolean
+          entity_type: node
+          entity_field: status
+          id: status
+          expose:
+            operator: ''
+            operator_limit_selection: false
+            operator_list: {  }
+          group: 1
+        type:
+          id: type
+          table: node_field_data
+          field: type
+          value:
+            static: static
+          entity_type: node
+          entity_field: type
+          plugin_id: bundle
+          expose:
+            operator_limit_selection: false
+            operator_list: {  }
+      sorts: {  }
+      header: {  }
+      footer: {  }
+      empty: {  }
+      relationships: {  }
+      arguments:
+        nid:
+          id: nid
+          table: node_field_data
+          field: nid
+          relationship: none
+          group_type: group
+          admin_label: ''
+          default_action: default
+          exception:
+            value: all
+            title_enable: false
+            title: All
+          title_enable: false
+          title: ''
+          default_argument_type: node
+          default_argument_options: {  }
+          default_argument_skip_url: false
+          summary_options:
+            base_path: ''
+            count: true
+            items_per_page: 25
+            override: false
+          summary:
+            sort_order: asc
+            number_of_records: 0
+            format: default_summary
+          specify_validation: true
+          validate:
+            type: none
+            fail: 'not found'
+          validate_options: {  }
+          break_phrase: false
+          not: false
+          entity_type: node
+          entity_field: nid
+          plugin_id: node_nid
+      display_extenders: {  }
+    cache_metadata:
+      max-age: -1
+      contexts:
+        - 'languages:language_content'
+        - 'languages:language_interface'
+        - url
+        - url.query_args
+        - 'user.node_grants:view'
+        - user.permissions
+      tags:
+        - 'config:field.storage.node.field_textes'
+  block_1:
+    display_plugin: block
+    id: block_1
+    display_title: 'Static textes paragraphes Bloc'
+    position: 1
+    display_options:
+      display_extenders:
+        views_ef_fieldset: {  }
+      display_description: ''
+    cache_metadata:
+      max-age: -1
+      contexts:
+        - 'languages:language_content'
+        - 'languages:language_interface'
+        - url
+        - url.query_args
+        - 'user.node_grants:view'
+        - user.permissions
+      tags:
+        - 'config:field.storage.node.field_textes'

+ 6 - 0
web/modules/custom/popsu_programme/config/schema/popsu_programme.schema.yml

@@ -0,0 +1,6 @@
+views.field.view_computed_themes_reference:
+  type: views_field
+  label: 'Computed Themes Reference'
+views.field.view_computed_projets_reference:
+  type: views_field
+  label: 'Computed Projets Reference'

+ 6 - 0
web/modules/custom/popsu_programme/popsu_programme.info.yml

@@ -0,0 +1,6 @@
+name: Popsu Programme
+type: module
+description: misc plugins for popsu's programmes.
+core_version_requirement: ^8.8 || ^9
+package: Popsu
+dependencies:

+ 88 - 0
web/modules/custom/popsu_programme/popsu_programme.module

@@ -0,0 +1,88 @@
+<?php
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Field\BaseFieldDefinition;
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+
+// https://www.drupal.org/project/drupal/issues/2916266#comment-12301574
+
+
+/**
+ * Implement hook_entity_bundle_field_info().
+ *
+ * @param EntityTypeInterface $entity_type
+ * @param $bundle
+ * @param array $base_field_definitions
+ * @return array
+ */
+function popsu_programme_entity_bundle_field_info(EntityTypeInterface $entity_type, $bundle, array $base_field_definitions) {
+// function materio_home_entity_base_field_info_alter(&$fields, EntityTypeInterface $entity_type) {
+  // $fields = array();
+  // if ($entity_type->id() == 'node' && $bundle === 'frontpage') {
+  // \Drupal::logger('materio_home')->notice('bundle: '.$bundle);
+  if ($entity_type->id() == 'node' && $bundle == 'programme') {
+    $fields['computed_themes_references'] = BaseFieldDefinition::create('entity_reference')
+      ->setName('computed_themes_references')
+      ->setLabel(t('Computed Themes References'))
+      ->setDescription(t('Computed Themes References.'))
+      // // The Entity Type this field belongs to.
+      ->setTargetEntityTypeId($entity_type->id())
+      // // The Entity Type bundle this field belongs to.
+      ->setTargetBundle($bundle)
+      ->setSetting('target_type', 'node')
+      ->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED)
+      ->setComputed(TRUE)
+      ->setRevisionable(FALSE)
+      ->setTranslatable(FALSE)
+      ->setDisplayConfigurable('view', TRUE)
+      ->setDisplayOptions('view', [
+          'label' => 'hidden',
+          'weight' => -5,
+        ])
+      ->setClass(\Drupal\popsu_programme\Plugin\Field\FieldType\ComputedThemesReferences::class);
+
+    $fields['computed_projets_references'] = BaseFieldDefinition::create('entity_reference')
+      ->setName('computed_projets_references')
+      ->setLabel(t('Computed Projets References'))
+      ->setDescription(t('Computed Projets References.'))
+      // // The Entity Type this field belongs to.
+      ->setTargetEntityTypeId($entity_type->id())
+      // // The Entity Type bundle this field belongs to.
+      ->setTargetBundle($bundle)
+      ->setSetting('target_type', 'node')
+      ->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED)
+      ->setComputed(TRUE)
+      ->setRevisionable(FALSE)
+      ->setTranslatable(FALSE)
+      ->setDisplayConfigurable('view', TRUE)
+      ->setDisplayOptions('view', [
+          'label' => 'hidden',
+          'weight' => -5,
+        ])
+      ->setClass(\Drupal\popsu_programme\Plugin\Field\FieldType\ComputedProjetsReferences::class);
+
+      return $fields;
+  }
+}
+
+
+/**
+ * Implements hook_views_data_alter().
+ */
+function popsu_programme_views_data_alter(array &$data) {
+  if (isset($data['node'])) {
+    // Add the computed_themes_reference field to Views.
+    $data['node']['computed_themes_reference'] = [
+      'title' => t('Computed Theme References'),
+      'field' => [
+        'id' => 'views_computed_themes_reference',
+      ],
+    ];
+    // Add the computed_projets_reference field to Views.
+    $data['node']['computed_projets_reference'] = [
+      'title' => t('Computed Projets References'),
+      'field' => [
+        'id' => 'views_computed_projets_reference',
+      ],
+    ];
+  }
+}

+ 58 - 0
web/modules/custom/popsu_programme/src/Plugin/Field/FieldType/ComputedProjetsReferences.php

@@ -0,0 +1,58 @@
+<?php
+
+namespace Drupal\popsu_programme\Plugin\Field\FieldType;
+
+use Drupal\Core\Entity\FieldableEntityInterface;
+use Drupal\Core\Field\EntityReferenceFieldItemList;
+use Drupal\Core\Field\EntityReferenceFieldItemListInterface;
+use Drupal\Core\Field\FieldItemList;
+use Drupal\Core\TypedData\TypedDataInterface;
+use Drupal\Core\Field\BaseFieldDefinition;
+use Drupal\Core\TypedData\ComputedItemListTrait;
+
+// https://www.drupal.org/node/2112677
+// https://www.cornel.co/article/entity-reference-computed-field-example-drupal
+// https://www.caxy.com/blog/drupal-custom-form-and-computed-fields
+
+class ComputedProjetsReferences extends EntityReferenceFieldItemList
+{
+  use ComputedItemListTrait;
+
+  /**
+   * The entity type manager.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
+   */
+  protected $entityTypeManager;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function __construct(BaseFieldDefinition $definition, $name, TypedDataInterface $parent) {
+    parent::__construct($definition, $name, $parent);
+    $this->entityTypeManager = \Drupal::entityTypeManager();
+  }
+
+  /**
+   * Compute the values.
+   */
+  protected function computeValue() {
+    // $query = \Drupal::entityQuery('node')
+    $entity = $this->getEntity();
+    $storage = \Drupal::service('entity_type.manager')->getStorage('node');
+    $query = $storage->getQuery()
+      ->condition('status', 1)
+      ->condition('type', 'projet')
+      ->condition('field_programme', $entity->id());
+    $results = $query->execute();
+    if ($results) {
+      $nids = array_values($results);
+      $i = 0;
+      foreach ($nids as $key => $nid) {
+        $this->list[$i] = $this->createItem($i, $nid);
+        $i++;
+      }
+    }
+  }
+
+}

+ 58 - 0
web/modules/custom/popsu_programme/src/Plugin/Field/FieldType/ComputedThemesReferences.php

@@ -0,0 +1,58 @@
+<?php
+
+namespace Drupal\popsu_programme\Plugin\Field\FieldType;
+
+use Drupal\Core\Entity\FieldableEntityInterface;
+use Drupal\Core\Field\EntityReferenceFieldItemList;
+use Drupal\Core\Field\EntityReferenceFieldItemListInterface;
+use Drupal\Core\Field\FieldItemList;
+use Drupal\Core\TypedData\TypedDataInterface;
+use Drupal\Core\Field\BaseFieldDefinition;
+use Drupal\Core\TypedData\ComputedItemListTrait;
+
+// https://www.drupal.org/node/2112677
+// https://www.cornel.co/article/entity-reference-computed-field-example-drupal
+// https://www.caxy.com/blog/drupal-custom-form-and-computed-fields
+
+class ComputedThemesReferences extends EntityReferenceFieldItemList
+{
+  use ComputedItemListTrait;
+
+  /**
+   * The entity type manager.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
+   */
+  protected $entityTypeManager;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function __construct(BaseFieldDefinition $definition, $name, TypedDataInterface $parent) {
+    parent::__construct($definition, $name, $parent);
+    $this->entityTypeManager = \Drupal::entityTypeManager();
+  }
+
+  /**
+   * Compute the values.
+   */
+  protected function computeValue() {
+    // $query = \Drupal::entityQuery('node')
+    $entity = $this->getEntity();
+    $storage = \Drupal::service('entity_type.manager')->getStorage('node');
+    $query = $storage->getQuery()
+      ->condition('status', 1)
+      ->condition('type', 'theme')
+      ->condition('field_programme', $entity->id());
+    $results = $query->execute();
+    if ($results) {
+      $nids = array_values($results);
+      $i = 0;
+      foreach ($nids as $key => $nid) {
+        $this->list[$i] = $this->createItem($i, $nid);
+        $i++;
+      }
+    }
+  }
+
+}

+ 46 - 0
web/modules/custom/popsu_programme/src/Plugin/views/field/ViewsComputedProjetsReference.php

@@ -0,0 +1,46 @@
+<?php
+
+namespace Drupal\popsu_programme\Plugin\views\field;
+
+use Drupal\views\ResultRow;
+use Drupal\views\Plugin\views\field\FieldPluginBase;
+
+/**
+ * A handler to provide proper displays for profile current company.
+ *
+ * @ingroup views_field_handlers
+ *
+ * @ViewsField("views_computed_projets_reference")
+ */
+class ViewsComputedProjetsReference extends FieldPluginBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function render(ResultRow $values) {
+    $relationship_entities = $values->_relationship_entities;
+    $projets = null;
+    // First check the referenced entity.
+    if (isset($relationship_entities['node'])) {
+      $node = $relationship_entities['node'];
+    }
+    else {
+      $node = $values->_entity;
+    }
+
+    $type = get_class($node);
+    if ($type === 'Drupal\node\Entity\Node') {
+      $projets = $node->get('computed_projets_references')->getvalue();
+    }
+
+    return count($projets) . ' villes';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function query() {
+    // This function exists to override parent query function.
+    // Do nothing.
+  }
+}

+ 46 - 0
web/modules/custom/popsu_programme/src/Plugin/views/field/ViewsComputedThemesReference.php

@@ -0,0 +1,46 @@
+<?php
+
+namespace Drupal\popsu_programme\Plugin\views\field;
+
+use Drupal\views\ResultRow;
+use Drupal\views\Plugin\views\field\FieldPluginBase;
+
+/**
+ * A handler to provide proper displays for profile current company.
+ *
+ * @ingroup views_field_handlers
+ *
+ * @ViewsField("views_computed_themes_reference")
+ */
+class ViewsComputedThemesReference extends FieldPluginBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function render(ResultRow $values) {
+    $relationship_entities = $values->_relationship_entities;
+    $themes = null;
+    // First check the referenced entity.
+    if (isset($relationship_entities['node'])) {
+      $node = $relationship_entities['node'];
+    }
+    else {
+      $node = $values->_entity;
+    }
+
+    $type = get_class($node);
+    if ($type === 'Drupal\node\Entity\Node') {
+      $themes = $node->get('computed_themes_references')->getvalue();
+    }
+
+    return count($themes) . ' themes';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function query() {
+    // This function exists to override parent query function.
+    // Do nothing.
+  }
+}