{{define "journeys_carpool"}}
{{ if eq (len .ViewState.carpools) 0}}

Aucun covoiturage disponible pour ce trajet.

{{end}} {{$first := true}} {{$i := 0}} {{range .ViewState.carpools}} {{$carpoolData := index .ExtraMembers "ocss"}} {{if $first}} {{$first = false}}
{{else}}
{{end}}
Trajet en covoiturage avec {{$carpoolData.Driver.Alias}}
{{$pickupDate := timeFrom $carpoolData.PassengerPickupDate}} {{if $pickupDate}}
Départ {{$pickupDate}}
{{end}}
{{if and $carpoolData.Price $carpoolData.Price.Amount}}
{{printf "%.2f" (round2 $carpoolData.Price.Amount)}}€
{{end}}
{{if $carpoolData.PassengerPickupAddress}}
{{$.IconSet.Icon "hero:outline/map-pin" "h-4 w-4 text-co-green mt-0.5"}}
Départ
{{$carpoolData.PassengerPickupAddress}}
{{end}} {{if $carpoolData.PassengerDropAddress}}
{{$.IconSet.Icon "hero:outline/flag" "h-4 w-4 text-co-red mt-0.5"}}
Arrivée
{{$carpoolData.PassengerDropAddress}}
{{end}}
{{if $carpoolData.WebUrl}} Voir l'offre sur {{$carpoolData.Operator}} {{end}}
{{end}}
{{end}}