Skip to content
Snippets Groups Projects
Commit 798a3dac authored by Alexis BENOIT's avatar Alexis BENOIT
Browse files

add presence of organization with coordinates in map layout

parent d88e9c18
No related branches found
No related tags found
No related merge requests found
......@@ -6,59 +6,61 @@
{{/* In map layout, all organization should have .path to get coordinates */}}
{{ $organizations := where .organizations "path" "ne" nil }}
<div class="transcription">
<details id="{{- $id_transcription -}}" class="map-transcription">
<summary aria-controls="{{- $id_transcription -}}" aria-expanded="false" data-describedby=".block-title">
{{ i18n "commons.accessibility.map_transcription" }}
</summary>
<ul>
{{ range $organizations }}
{{ with site.GetPage .path }}
{{ $address_geolocation := .Params.contact_details.postal_address.geolocation }}
{{ if $address_geolocation }}
<li>
{{ template "organization" (dict
"title" .Title
"summary" .Params.summary
"contact_details" .Params.contact_details
"options" (dict
"summary" $options.summary
"link" $options.link
)
)}}
</li>
{{ if $organizations }}
<div class="transcription">
<details id="{{- $id_transcription -}}" class="map-transcription">
<summary aria-controls="{{- $id_transcription -}}" aria-expanded="false" data-describedby=".block-title">
{{ i18n "commons.accessibility.map_transcription" }}
</summary>
<ul>
{{ range $organizations }}
{{ with site.GetPage .path }}
{{ $address_geolocation := .Params.contact_details.postal_address.geolocation }}
{{ if $address_geolocation }}
<li>
{{ template "organization" (dict
"title" .Title
"summary" .Params.summary
"contact_details" .Params.contact_details
"options" (dict
"summary" $options.summary
"link" $options.link
)
)}}
</li>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</ul>
</details>
</div>
</ul>
</details>
</div>
{{ $title := printf "%s %d" (i18n "blocks.organizations.title") $block_index }}
{{ if .title }}
{{ $title = .title }}
{{ end }}
{{ $title := printf "%s %d" (i18n "blocks.organizations.title") $block_index }}
{{ if .title }}
{{ $title = .title }}
{{ end }}
{{ $aria_label := i18n "commons.maps.label" $title }}
<div class="organizations map"
data-map data-marker-icon="{{ site.Params.organizations.map_marker_icon | default "/assets/images/map-marker.svg" }}"
role="region"
aria-label="{{ $aria_label }}"
>
{{- range $organizations }}
{{ with site.GetPage .path }}
{{ $address_geolocation := .Params.contact_details.postal_address.geolocation }}
{{ if $address_geolocation }}
{{ template "organization" dict
"title" .Title
"url" .Permalink
"logo" (index .Params $logo_index)
"latitude" $address_geolocation.latitude
"longitude" $address_geolocation.longitude
"summary" .Params.summary
"options" $options
}}
{{ $aria_label := i18n "commons.maps.label" $title }}
<div class="organizations map"
data-map data-marker-icon="{{ site.Params.organizations.map_marker_icon | default "/assets/images/map-marker.svg" }}"
role="region"
aria-label="{{ $aria_label }}"
>
{{- range $organizations }}
{{ with site.GetPage .path }}
{{ $address_geolocation := .Params.contact_details.postal_address.geolocation }}
{{ if $address_geolocation }}
{{ template "organization" dict
"title" .Title
"url" .Permalink
"logo" (index .Params $logo_index)
"latitude" $address_geolocation.latitude
"longitude" $address_geolocation.longitude
"summary" .Params.summary
"options" $options
}}
{{ end }}
{{ end }}
{{ end }}
{{ end -}}
</div>
\ No newline at end of file
{{ end -}}
</div>
{{ end }}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment