nouvelles cartes projet + quelques corrections

This commit is contained in:
Valentin Le Moign 2025-02-03 23:23:52 +01:00
parent d912155cd0
commit 1a22f4c4c3
16 changed files with 241 additions and 224 deletions

133
composer.lock generated
View File

@ -2339,17 +2339,17 @@
}, },
{ {
"name": "drupal/block_class", "name": "drupal/block_class",
"version": "4.0.0", "version": "2.0.12",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.drupalcode.org/project/block_class.git", "url": "https://git.drupalcode.org/project/block_class.git",
"reference": "4.0.0" "reference": "2.0.12"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://ftp.drupal.org/files/projects/block_class-4.0.0.zip", "url": "https://ftp.drupal.org/files/projects/block_class-2.0.12.zip",
"reference": "4.0.0", "reference": "2.0.12",
"shasum": "4ed97a78db9b52f28e46d377947fecfb3a8c9580" "shasum": "cc3945f8038bcc9bb48eff897df332aa952d62e6"
}, },
"require": { "require": {
"drupal/core": "^9 || ^10 || ^11" "drupal/core": "^9 || ^10 || ^11"
@ -2357,8 +2357,8 @@
"type": "drupal-module", "type": "drupal-module",
"extra": { "extra": {
"drupal": { "drupal": {
"version": "4.0.0", "version": "2.0.12",
"datestamp": "1730640283", "datestamp": "1723243074",
"security-coverage": { "security-coverage": {
"status": "covered", "status": "covered",
"message": "Covered by Drupal's security advisory policy" "message": "Covered by Drupal's security advisory policy"
@ -2618,30 +2618,27 @@
}, },
{ {
"name": "drupal/config_ignore", "name": "drupal/config_ignore",
"version": "3.3.0", "version": "2.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.drupalcode.org/project/config_ignore.git", "url": "https://git.drupalcode.org/project/config_ignore.git",
"reference": "8.x-3.3" "reference": "8.x-2.4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://ftp.drupal.org/files/projects/config_ignore-8.x-3.3.zip", "url": "https://ftp.drupal.org/files/projects/config_ignore-8.x-2.4.zip",
"reference": "8.x-3.3", "reference": "8.x-2.4",
"shasum": "4446811ecb023820a57c227d35c034e0d4363a70" "shasum": "e0e45dde2d6927c5d26de59f352792fb6cf26554"
}, },
"require": { "require": {
"drupal/core": "^8.8 || ^9 || ^10 || ^11" "drupal/config_filter": "^1 || ^2",
}, "drupal/core": "^8 || ^9 || ^10"
"require-dev": {
"drupal/config_filter": "^1.8||^2.2",
"drush/drush": "^10 || ^11 || ^12"
}, },
"type": "drupal-module", "type": "drupal-module",
"extra": { "extra": {
"drupal": { "drupal": {
"version": "8.x-3.3", "version": "8.x-2.4",
"datestamp": "1713299496", "datestamp": "1676045435",
"security-coverage": { "security-coverage": {
"status": "covered", "status": "covered",
"message": "Covered by Drupal's security advisory policy" "message": "Covered by Drupal's security advisory policy"
@ -2669,11 +2666,12 @@
"homepage": "https://www.drupal.org/user/413139" "homepage": "https://www.drupal.org/user/413139"
} }
], ],
"description": "Ignore certain configuration during import and export.", "description": "Ignore certain configuration during import.",
"homepage": "http://drupal.org/project/config_ignore", "homepage": "http://drupal.org/project/config_ignore",
"support": { "support": {
"source": "https://git.drupalcode.org/project/config_ignore", "source": "https://git.drupalcode.org/project/config_ignore",
"issues": "http://drupal.org/project/config_ignore" "issues": "https://drupal.org/project/config_ignore",
"irc": "irc://irc.freenode.org/drupal-contribute"
} }
}, },
{ {
@ -4129,26 +4127,26 @@
}, },
{ {
"name": "drupal/extlink", "name": "drupal/extlink",
"version": "2.0.4", "version": "1.7.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.drupalcode.org/project/extlink.git", "url": "https://git.drupalcode.org/project/extlink.git",
"reference": "2.0.4" "reference": "8.x-1.7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://ftp.drupal.org/files/projects/extlink-2.0.4.zip", "url": "https://ftp.drupal.org/files/projects/extlink-8.x-1.7.zip",
"reference": "2.0.4", "reference": "8.x-1.7",
"shasum": "0331ef3457d3a1701f01e04f8256bdd823ea3512" "shasum": "38650688b5a58496db59f40b2a7f36c4bedcbfb4"
}, },
"require": { "require": {
"drupal/core": "^10 || ^11" "drupal/core": "^8 || ^9 || ^10"
}, },
"type": "drupal-module", "type": "drupal-module",
"extra": { "extra": {
"drupal": { "drupal": {
"version": "2.0.4", "version": "8.x-1.7",
"datestamp": "1732565828", "datestamp": "1665770295",
"security-coverage": { "security-coverage": {
"status": "covered", "status": "covered",
"message": "Covered by Drupal's security advisory policy" "message": "Covered by Drupal's security advisory policy"
@ -4864,21 +4862,20 @@
}, },
{ {
"name": "drupal/inline_entity_form", "name": "drupal/inline_entity_form",
"version": "3.0.0-rc20", "version": "1.0.0-rc17",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.drupalcode.org/project/inline_entity_form.git", "url": "https://git.drupalcode.org/project/inline_entity_form.git",
"reference": "3.0.0-rc20" "reference": "8.x-1.0-rc17"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://ftp.drupal.org/files/projects/inline_entity_form-3.0.0-rc20.zip", "url": "https://ftp.drupal.org/files/projects/inline_entity_form-8.x-1.0-rc17.zip",
"reference": "3.0.0-rc20", "reference": "8.x-1.0-rc17",
"shasum": "c9ad4572bce4260d1d233a0c3196e4ff0915e4ee" "shasum": "626622e01cf7a2d2977fdc06ae09afd5a814e09b"
}, },
"require": { "require": {
"drupal/core": "^8.8 || ^9 || ^10 || ^11", "drupal/core": "^8.8 || ^9 || ^10",
"drupal/rat": "^1.0.0@stable",
"php": ">=7.1" "php": ">=7.1"
}, },
"require-dev": { "require-dev": {
@ -4887,8 +4884,8 @@
"type": "drupal-module", "type": "drupal-module",
"extra": { "extra": {
"drupal": { "drupal": {
"version": "3.0.0-rc20", "version": "8.x-1.0-rc17",
"datestamp": "1722000368", "datestamp": "1703020130",
"security-coverage": { "security-coverage": {
"status": "not-covered", "status": "not-covered",
"message": "RC releases are not covered by Drupal security advisories." "message": "RC releases are not covered by Drupal security advisories."
@ -6716,48 +6713,6 @@
"source": "https://git.drupalcode.org/project/profile" "source": "https://git.drupalcode.org/project/profile"
} }
}, },
{
"name": "drupal/rat",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/rat.git",
"reference": "28202b02262a39ac8dbbfd43696b67c0c8c46b71"
},
"dist": {
"type": "zip",
"url": "https://git.drupalcode.org/api/v4/projects/project%2Frat/repository/archive.zip?sha=28202b02262a39ac8dbbfd43696b67c0c8c46b71",
"reference": "28202b02262a39ac8dbbfd43696b67c0c8c46b71",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0"
},
"require-dev": {
"drupal/core": "^9.4",
"drupal/core-dev": "^9.4"
},
"type": "library",
"autoload": {
"psr-4": {
"Drupal\\rat\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"gpl-2.0-or-later"
],
"authors": [
{
"name": "Merlin",
"email": "merlin@geeks4change.net"
}
],
"support": {
"source": "https://git.drupalcode.org/project/rat/-/tree/1.0.0"
},
"time": "2023-07-19T22:22:22+00:00"
},
{ {
"name": "drupal/redirect", "name": "drupal/redirect",
"version": "1.11.0", "version": "1.11.0",
@ -7979,21 +7934,20 @@
}, },
{ {
"name": "drupal/views_bulk_edit", "name": "drupal/views_bulk_edit",
"version": "3.0.0", "version": "2.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.drupalcode.org/project/views_bulk_edit.git", "url": "https://git.drupalcode.org/project/views_bulk_edit.git",
"reference": "3.0.0" "reference": "8.x-2.9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://ftp.drupal.org/files/projects/views_bulk_edit-3.0.0.zip", "url": "https://ftp.drupal.org/files/projects/views_bulk_edit-8.x-2.9.zip",
"reference": "3.0.0", "reference": "8.x-2.9",
"shasum": "3b16079aa95fb4834561fcfd1197cce73b7f4b88" "shasum": "db45a8cc9ac629859374b24974eafcef257e4387"
}, },
"require": { "require": {
"drupal/core": "^9.4 || ^10 || ^11", "drupal/core": "^9.4 || ^10"
"php": ">=8.1"
}, },
"require-dev": { "require-dev": {
"drupal/views_bulk_operations": "~4.2.4" "drupal/views_bulk_operations": "~4.2.4"
@ -8004,8 +7958,8 @@
"type": "drupal-module", "type": "drupal-module",
"extra": { "extra": {
"drupal": { "drupal": {
"version": "3.0.0", "version": "8.x-2.9",
"datestamp": "1725358398", "datestamp": "1690222256",
"security-coverage": { "security-coverage": {
"status": "covered", "status": "covered",
"message": "Covered by Drupal's security advisory policy" "message": "Covered by Drupal's security advisory policy"
@ -13161,6 +13115,7 @@
"drupal/agreement": 15, "drupal/agreement": 15,
"drupal/bulkdelete": 20, "drupal/bulkdelete": 20,
"drupal/config_devel": 20, "drupal/config_devel": 20,
"drupal/config_ignore": 5,
"drupal/config_update": 15, "drupal/config_update": 15,
"drupal/context": 5, "drupal/context": 5,
"drupal/date_range_formatter": 20, "drupal/date_range_formatter": 20,

View File

@ -1,4 +1,4 @@
_core: _core:
default_config_hash: LzdDtE3Im_Ysio7g1Eo8ymSMq0mgSQMPzv0khsr_J64 default_config_hash: LzdDtE3Im_Ysio7g1Eo8ymSMq0mgSQMPzv0khsr_J64
mode: simple
ignored_config_entities: { } ignored_config_entities: { }
mode: simple

View File

@ -35,6 +35,15 @@ targetEntityType: node
bundle: projet bundle: projet
mode: full mode: full
content: content:
field_carte:
type: entity_reference_revisions_entity_view
label: above
settings:
view_mode: default
link: ''
third_party_settings: { }
weight: 7
region: content
field_chiffres_clefs: field_chiffres_clefs:
type: entity_reference_revisions_entity_view type: entity_reference_revisions_entity_view
label: visually_hidden label: visually_hidden
@ -51,7 +60,7 @@ content:
view_mode: default view_mode: default
link: '' link: ''
third_party_settings: { } third_party_settings: { }
weight: 10 weight: 9
region: content region: content
field_collectif_du_projet: field_collectif_du_projet:
type: entity_reference_revisions_entity_view type: entity_reference_revisions_entity_view
@ -60,7 +69,7 @@ content:
view_mode: default view_mode: default
link: '' link: ''
third_party_settings: { } third_party_settings: { }
weight: 11 weight: 10
region: content region: content
field_diaporama: field_diaporama:
type: image_caption type: image_caption
@ -85,7 +94,7 @@ content:
label: above label: above
settings: { } settings: { }
third_party_settings: { } third_party_settings: { }
weight: 9 weight: 8
region: content region: content
field_liens: field_liens:
type: link type: link
@ -97,7 +106,7 @@ content:
rel: '' rel: ''
target: '' target: ''
third_party_settings: { } third_party_settings: { }
weight: 14 weight: 13
region: content region: content
field_localisation_textuel: field_localisation_textuel:
type: string type: string
@ -113,7 +122,7 @@ content:
settings: settings:
use_description_as_link_text: true use_description_as_link_text: true
third_party_settings: { } third_party_settings: { }
weight: 13 weight: 12
region: content region: content
field_pour_aller_plus_loin: field_pour_aller_plus_loin:
type: entity_reference_label type: entity_reference_label
@ -121,7 +130,7 @@ content:
settings: settings:
link: true link: true
third_party_settings: { } third_party_settings: { }
weight: 12 weight: 11
region: content region: content
field_sous_titre: field_sous_titre:
type: string type: string
@ -150,7 +159,6 @@ content:
region: content region: content
hidden: hidden:
field_actualites_liees: true field_actualites_liees: true
field_carte: true
field_poids: true field_poids: true
field_session: true field_session: true
langcode: true langcode: true

View File

@ -3,26 +3,26 @@ _core:
langcode: fr langcode: fr
extlink_target: false extlink_target: false
extlink_target_no_override: false extlink_target_no_override: false
extlink_title_no_override: false
extlink_nofollow: false extlink_nofollow: false
extlink_follow_no_override: false extlink_follow_no_override: false
extlink_subdomains: true extlink_subdomains: true
extlink_alert: false extlink_alert: false
extlink_alert_text: 'Ce lien vous dirige vers un site externe. Nous ne sommes pas responsables de son contenu.' extlink_alert_text: 'Ce lien vous dirige vers un site externe. Nous ne sommes pas responsables de son contenu.'
extlink_additional_link_classes: ''
extlink_additional_mailto_classes: ''
extlink_additional_tel_classes: ''
extlink_exclude: '' extlink_exclude: ''
extlink_include: '' extlink_include: ''
extlink_exclude_noreferrer: ''
extlink_class: ext extlink_class: ext
extlink_label: '(le lien est externe)' extlink_label: '(le lien est externe)'
extlink_img_class: false extlink_img_class: false
extlink_css_exclude: '' extlink_css_exclude: ''
extlink_css_include: ''
extlink_css_explicit: '' extlink_css_explicit: ''
extlink_mailto_class: mailto extlink_mailto_class: mailto
extlink_mailto_label: '(link sends email)' extlink_mailto_label: '(link sends email)'
extlink_title_no_override: false
extlink_additional_link_classes: ''
extlink_additional_mailto_classes: ''
extlink_additional_tel_classes: ''
extlink_exclude_noreferrer: ''
extlink_css_include: ''
extlink_tel_class: '' extlink_tel_class: ''
extlink_tel_label: '(link is a phone number)' extlink_tel_label: '(link is a phone number)'
extlink_prevent_orphan: false extlink_prevent_orphan: false

View File

@ -60,6 +60,9 @@ variant_settings:
builder: standard builder: standard
storage_type: page_manager storage_type: page_manager
storage_id: home-panels_variant-0 storage_id: home-panels_variant-0
css_classes: { }
html_id: ''
css_styles: ''
page: home page: home
selection_criteria: { } selection_criteria: { }
selection_logic: and selection_logic: and

View File

@ -77,6 +77,7 @@ display:
type: mini type: mini
options: options:
offset: 0 offset: 0
pagination_heading_level: h4
items_per_page: 10 items_per_page: 10
total_pages: null total_pages: null
id: 0 id: 0
@ -91,7 +92,6 @@ display:
items_per_page_options_all_label: '- Tout -' items_per_page_options_all_label: '- Tout -'
offset: false offset: false
offset_label: Décalage offset_label: Décalage
pagination_heading_level: h4
exposed_form: exposed_form:
type: basic type: basic
options: options:
@ -119,7 +119,7 @@ display:
group_type: group group_type: group
admin_label: '' admin_label: ''
plugin_id: datetime plugin_id: datetime
order: ASC order: DESC
expose: expose:
label: '' label: ''
field_identifier: '' field_identifier: ''
@ -224,51 +224,6 @@ display:
plugin_id: bundle plugin_id: bundle
value: value:
actualite: actualite actualite: actualite
field_date_end_value:
id: field_date_end_value
table: node__field_date
field: field_date_end_value
relationship: none
group_type: group
admin_label: ''
plugin_id: datetime
operator: '>'
value:
min: ''
max: ''
value: 'now -1 day'
type: date
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
min_placeholder: ''
max_placeholder: ''
placeholder: ''
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
promote: promote:
id: promote id: promote
table: node_field_data table: node_field_data

View File

@ -6,7 +6,7 @@ dependencies:
- core.entity_view_mode.node.full - core.entity_view_mode.node.full
- node.type.partenaire - node.type.partenaire
content: content:
- 'config_pages:partenaires:8ec9ecf0-611e-4dfb-b1e4-11e5856c211a' - 'config_pages:partenaires:f290f948-2dd5-4625-9f1b-bc2d63f3a13f'
module: module:
- node - node
- user - user
@ -157,7 +157,7 @@ display:
admin_label: '' admin_label: ''
plugin_id: entity plugin_id: entity
empty: false empty: false
target: 8ec9ecf0-611e-4dfb-b1e4-11e5856c211a target: f290f948-2dd5-4625-9f1b-bc2d63f3a13f
view_mode: default view_mode: default
tokenize: true tokenize: true
bypass_access: false bypass_access: false

View File

@ -10,7 +10,6 @@
* @see index.php * @see index.php
* @see core/install.php * @see core/install.php
* @see core/rebuild.php * @see core/rebuild.php
* @see core/modules/statistics/statistics.php
*/ */
return require __DIR__ . '/../vendor/autoload.php'; return require __DIR__ . '/../vendor/autoload.php';

@ -1 +1 @@
Subproject commit 0072fa85fb15b168503b63af2b7df56f2a5e2b67 Subproject commit 6122ad5f5b1519bcca5014ea331ae61415480ea3

View File

@ -776,6 +776,9 @@ em {
padding: 5px 3vw; padding: 5px 3vw;
padding-left: 0 !important; padding-left: 0 !important;
} }
.views-row article.actu-teaser .preview_sous_titre .sous_titre {
line-height: 1.3 !important;
}
@media (min-width: 760px) { @media (min-width: 760px) {
.views-row article.actu-teaser .preview_sous_titre { .views-row article.actu-teaser .preview_sous_titre {
padding-left: unset; padding-left: unset;
@ -1386,11 +1389,15 @@ main.main-login .login > div > div:not(.hidden) form .button:hover, main.main-lo
margin-bottom: 1rem; margin-bottom: 1rem;
} }
.layout-content .fullpage .fullpage_content .sous_titre { .layout-content .fullpage .fullpage_content .sous_titre {
font-size: 1.2rem;
padding: 0 3vw; padding: 0 3vw;
font-family: "Marianne", sans-serif; font-family: "Barlow", sans-serif;
font-size: 1rem; color: black;
line-height: 1.4; font-size: 1.2rem;
}
@media (min-width: 760px) {
.layout-content .fullpage .fullpage_content .sous_titre {
font-size: 1.6rem;
}
} }
.layout-content .fullpage .fullpage_content p { .layout-content .fullpage .fullpage_content p {
padding: 0 3vw; padding: 0 3vw;
@ -1861,6 +1868,16 @@ aside.layout-sidebar-first:has(#block-erabletheme-views-block-projets-block-1) >
} }
} }
*/ */
.content_partenaires header {
font-family: "Marianne", sans-serif;
font-size: 1rem;
line-height: 1.4;
margin-bottom: 4vh;
margin-top: -5vh;
}
.content_partenaires header p {
margin: 1rem 3vw;
}
.content_partenaires .views-row { .content_partenaires .views-row {
margin-bottom: 2vh; margin-bottom: 2vh;
} }
@ -2956,25 +2973,31 @@ aside.layout-sidebar-first:has(#block-erabletheme-views-block-projets-block-1) >
margin: 0 3vw; margin: 0 3vw;
margin-top: 4rem; margin-top: 4rem;
} }
.fullpage.projet_full .carte > div > div:first-of-type {
display: none;
}
.fullpage.projet_full .carte .leaflet-pane path { .fullpage.projet_full .carte .leaflet-pane path {
stroke: #00ff80; stroke: #00ff80;
stroke-width: 2; stroke-width: 2;
fill: #00ff80; fill: #00ff80;
fill-opacity: 0.2; fill-opacity: 0.2;
} }
.fullpage.projet_full .carte #leaflet-popup { .fullpage.projet_full .carte .popup .leaflet-popup-tip {
position: fixed; background: rgba(0, 0, 0, 0) !important;
box-shadow: none !important;
}
.fullpage.projet_full .carte .popup .leaflet-popup-content-wrapper {
padding: 0.3rem 0.8rem; padding: 0.3rem 0.8rem;
background-color: white; background-color: white;
font-size: 0.8rem !important; font-size: 0.8rem !important;
opacity: 0; box-shadow: none;
transition: opacity 0.3s ease; border-radius: unset;
font-family: "Marianne", sans-serif; font-family: "Marianne", sans-serif;
font-size: 1rem; font-size: 1rem;
line-height: 1.4; line-height: 1.4;
} }
.fullpage.projet_full .libelles-carte { .fullpage.projet_full .carte .popup .leaflet-popup-content-wrapper .leaflet-popup-content {
display: none; margin: 0;
} }
.fullpage.projet_full .legende-carte > div > div:first-of-type { .fullpage.projet_full .legende-carte > div > div:first-of-type {
display: none; display: none;

File diff suppressed because one or more lines are too long

View File

@ -335,10 +335,10 @@
// //
document.querySelectorAll('p, li, h1, h2, h3, h4, h5, h6').forEach((content) => { document.querySelectorAll('p, li, h1, h2, h3, h4, h5, h6').forEach((content) => {
content.innerHTML = content.innerHTML.replaceAll(' ;', ' '); content.innerHTML = content.innerHTML.replaceAll(' ;', ' ;');
content.innerHTML = content.innerHTML.replaceAll(' :', ' '); content.innerHTML = content.innerHTML.replaceAll(' :', ' :');
content.innerHTML = content.innerHTML.replaceAll(' ?', ' '); content.innerHTML = content.innerHTML.replaceAll(' ?', ' ?');
content.innerHTML = content.innerHTML.replaceAll(' !', ' '); content.innerHTML = content.innerHTML.replaceAll(' !', ' !');
content.innerHTML = content.innerHTML.replaceAll('« ', '« '); content.innerHTML = content.innerHTML.replaceAll('« ', '« ');
content.innerHTML = content.innerHTML.replaceAll(' »', ' »'); content.innerHTML = content.innerHTML.replaceAll(' »', ' »');
content.innerHTML = content.innerHTML.replaceAll('(« ', '(« '); content.innerHTML = content.innerHTML.replaceAll('(« ', '(« ');
@ -393,58 +393,114 @@
} }
} }
let firstMap = null;
Drupal.behaviors.customLeafletInteraction = { Drupal.behaviors.customLeafletInteraction = {
attach: function (context, settings) { attach: function (context, settings) {
$(context).on('leafletMapInit', function (e, settings, map, mapid, markers) { $(context).on('leafletMapInit', function (e, settings, map, mapid, markers) {
//
// on projects pages, replace leaflet icons with erable leafs
//
const leafletIcons = document.querySelectorAll('.leaflet-marker-pane img');
for (let icon of leafletIcons) {
icon.setAttribute('src', '/themes/erabletheme/assets/leaf.svg');
}
// if (document.querySelector('.projet_full')) {
// set hover on leaflet marker and zones // map on the projects page
//
const leafletPlaces = document.querySelectorAll('.leaflet-marker-pane img, .leaflet-overlay-pane path'); let customIcon = L.icon({
const libelles = document.querySelectorAll('.libelles-carte > div > div > div'); iconUrl: '/themes/erabletheme/assets/leaf.svg',
iconSize: [20, 20],
iconAnchor: [10, 20],
popupAnchor: [0, -20]
});
for (let i = 0; i < leafletPlaces.length; i++) { let initiatedMap = document.querySelector(`#${mapid}`);
const carte = document.querySelector('.carte'); const currentLibelle = initiatedMap.parentElement.nextElementSibling.innerText;
initiatedMap.parentElement.nextElementSibling.remove();
if (document.querySelectorAll('.leaflet-container').length <= 1) {
firstMap = map;
let bounds = L.latLngBounds();
map.eachLayer(function (layer) {
if (layer instanceof L.Marker && !layer._popup) {
layer.bindPopup(currentLibelle, { closeButton: false, className: 'popup' })
.setIcon(customIcon)
.on('mouseover', function () {
this.openPopup();
})
.on('mouseout', function () {
this.closePopup();
});
leafletPlaces[i].addEventListener('mouseenter', () => { bounds.extend(layer.getLatLng());
let div = document.createElement('div'); map.fitBounds(bounds, { padding: [30, 30], maxZoom: 18 });
div.setAttribute('id', 'leaflet-popup'); }
div.style.zIndex = '100'; });
const x = leafletPlaces[i].getBoundingClientRect().left + leafletPlaces[i].getBoundingClientRect().width / 2; } else {
const y = leafletPlaces[i].getBoundingClientRect().top; // map on the projects index
setTimeout(() => {
div.style.opacity = 1; document.querySelector(`#${mapid}`).parentElement.parentElement.parentElement.remove();
const divHeight = div.getBoundingClientRect().height; const firstMarker = Object.values(markers)[0];
const divWidth = div.getBoundingClientRect().width; let newMarker = L.marker([firstMarker._latlng.lat, firstMarker._latlng.lng], { icon: customIcon })
.addTo(firstMap)
.bindPopup(currentLibelle, { closeButton: false, className: 'popup' })
.on('mouseover', function () {
this.openPopup();
})
.on('mouseout', function () {
this.closePopup();
});
firstMap.fitBounds(
firstMap.getBounds().extend(newMarker.getLatLng()),
{ padding: [30, 30], maxZoom: 18 }
);
}
} else {
//
// on projects pages, replace leaflet icons with erable leafs
//
const currentMap = document.querySelector('.leaflet-container');
const leafletIcons = document.querySelectorAll('.leaflet-marker-pane img');
for (let icon of leafletIcons) {
icon.setAttribute('src', '/themes/erabletheme/assets/leaf.svg');
}
//
// set hover on leaflet marker and zones
//
const leafletPlaces = document.querySelectorAll('.leaflet-marker-pane img, .leaflet-overlay-pane path');
const libelles = document.querySelectorAll('.libelles-carte > div > div > div');
for (let i = 0; i < leafletPlaces.length; i++) {
const carte = document.querySelector('.carte');
leafletPlaces[i].addEventListener('mouseenter', () => {
let div = document.createElement('div');
div.setAttribute('id', 'leaflet-popup');
div.style.zIndex = '100';
const x = leafletPlaces[i].getBoundingClientRect().left + leafletPlaces[i].getBoundingClientRect().width / 2;
const y = leafletPlaces[i].getBoundingClientRect().top;
setTimeout(() => { setTimeout(() => {
div.style.left = `${x - divWidth / 2}px`; div.style.opacity = 1;
div.style.top = `${y - divHeight}px`; const divHeight = div.getBoundingClientRect().height;
const divWidth = div.getBoundingClientRect().width;
setTimeout(() => {
div.style.left = `${x - divWidth / 2}px`;
div.style.top = `${y - divHeight}px`;
}, 10);
}, 10); }, 10);
}, 10);
div.innerText = libelles[i].innerText;
div.innerText = libelles[i].innerText;
carte.appendChild(div);
carte.appendChild(div); });
}); leafletPlaces[i].addEventListener('mouseleave', () => {
leafletPlaces[i].addEventListener('mouseleave', () => { let divs = document.querySelectorAll('#leaflet-popup');
let divs = document.querySelectorAll('#leaflet-popup'); for (let div of divs) {
for (let div of divs) { div.style.opacity = 0;
div.style.opacity = 0; setTimeout(() => {
setTimeout(() => { div.remove();
div.remove(); }, 300);
}, 300); }
} });
}); }
} }
}); });
} }
} }

View File

@ -27,9 +27,8 @@
} }
.sous_titre { .sous_titre {
font-size: $l_font_size;
padding: 0 $x_margin; padding: 0 $x_margin;
@include main_text_content(); @include sous_titre_alt();
} }
p { p {

View File

@ -1,4 +1,12 @@
.content_partenaires { .content_partenaires {
header {
@include main_text_content();
margin-bottom: 4vh;
margin-top: -5vh;
p {
margin: 1rem $x_margin;
}
}
.views-row { .views-row {
margin-bottom: 2vh; margin-bottom: 2vh;
article { article {

View File

@ -307,6 +307,9 @@
width: auto; width: auto;
margin: 0 $x_margin; margin: 0 $x_margin;
margin-top: 4rem; margin-top: 4rem;
> div > div:first-of-type {
display: none;
}
.leaflet-pane { .leaflet-pane {
path { path {
stroke: $fluo_green; stroke: $fluo_green;
@ -315,19 +318,24 @@
fill-opacity: 0.2; fill-opacity: 0.2;
} }
} }
#leaflet-popup { .popup {
position: fixed; .leaflet-popup-tip {
padding: 0.3rem 0.8rem; background: rgba(0, 0, 0, 0) !important;
background-color: white; box-shadow: none !important;
font-size: $sm_font_size !important; }
opacity: 0; .leaflet-popup-content-wrapper {
transition: opacity 0.3s ease; padding: 0.3rem 0.8rem;
@include main_text_content(); background-color: white;
font-size: $sm_font_size !important;
box-shadow: none;
border-radius: unset;
@include main_text_content();
.leaflet-popup-content {
margin: 0;
}
}
} }
} }
.libelles-carte {
display: none;
}
.legende-carte { .legende-carte {
> div > div:first-of-type { > div > div:first-of-type {
display: none; display: none;

View File

@ -47,6 +47,9 @@
font-size: $m_font_size; font-size: $m_font_size;
padding: 5px $x_margin; padding: 5px $x_margin;
padding-left: 0 !important; padding-left: 0 !important;
.sous_titre {
line-height: 1.3 !important;
}
@media (min-width: $breakpoint_tablet) { @media (min-width: $breakpoint_tablet) {
padding-left: unset; padding-left: unset;
font-size: $l_font_size; font-size: $l_font_size;