{{define "content"}}

Transport solidaire

{{if and .ViewState.booking.Data.motivation (isGuaranteedTripMotivation .ViewState.booking.Data.motivation)}}
Trajet garanti : {{.ViewState.booking.Data.motivation}}
{{end}} {{ if eq .ViewState.booking.Status "WAITING_CONFIRMATION"}}
Attente confirmation
{{ else if eq .ViewState.booking.Status "VALIDATED"}}
Validé
{{ else if eq .ViewState.booking.Status "CANCELLED"}}
Annulé{{if .ViewState.booking.Data.reason}} : {{.ViewState.booking.Data.reason}}{{end}}
{{ end }}
{{if eq .ViewState.booking.Status "WAITING_CONFIRMATION" }} {{end}} {{if ne .ViewState.booking.Status "WAITING_CONFIRMATION" }} {{end}} {{if ne .ViewState.booking.Status "CANCELLED" }} {{$dialog := "cancel"}}
{{end}} {{if eq .ViewState.booking.Status "CANCELLED" }} {{end}}

Détails du transport solidaire

Informations sur le trajet

Départ conducteur
{{ .ViewState.booking.Journey.DriverDeparture.Properties.label }}
Prise en charge passager
{{ .ViewState.booking.Journey.PassengerPickup.Properties.label }}
Dépose passager
{{ .ViewState.booking.Journey.PassengerDrop.Properties.label }}
Arrivée conducteur
{{ .ViewState.booking.Journey.DriverArrival.Properties.label }}
Date et heure
{{ timeFormat .ViewState.booking.Journey.PassengerPickupDate "02/01/2006 15:04" }}
Type de trajet
{{if .ViewState.booking.Journey.Noreturn}} Aller simple (pas de retour) {{else}} Aller-retour ({{.ViewState.booking.ReturnWaitingDuration | shortDuration}} d'attente estimée sur place) {{end}}
{{if .ViewState.booking.Data.motivation}}
Motif
{{$motivation := .ViewState.booking.Data.motivation}} {{$found := false}} {{range .ViewState.booking_motivations}} {{if eq .value $motivation}} {{.label}} {{$found = true}} {{end}} {{end}} {{if not $found}}{{$motivation}}{{end}}
{{end}}
Distance passager
{{ .ViewState.booking.Journey.PassengerDistance }} km
Distance conducteur
{{ .ViewState.booking.Journey.DriverDistance }} km
Prix (passager)
{{ printf "%.2f" (round2 .ViewState.booking.Journey.Price.Amount) }} {{ .ViewState.booking.Journey.Price.Currency }}
{{if .ViewState.booking.DriverCompensationAmount}} {{if gt (round2 .ViewState.booking.DriverCompensationAmount) 0.0}}
Indemnité conducteur
{{ printf "%.2f" (round2 .ViewState.booking.DriverCompensationAmount) }} {{.ViewState.booking.DriverCompensationCurrency}}
{{end}} {{end}}
{{ template "journey_map" (dict "driver_journey" .ViewState.booking.Journey) }}
{{ end }}