187 lines
12 KiB
HTML
187 lines
12 KiB
HTML
{{define "content"}}
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
|
<h1 class="text-2xl font-semibold text-gray-900">
|
|
Covoiturage solidaire
|
|
</h1>
|
|
|
|
{{ if eq .ViewState.booking.Status.String "WAITING_DRIVER_CONFIRMATION"}}
|
|
<div class="mt-4"><span class="p-2 text-sm bg-gray-300 rounded-2xl px-4">Attente confirmation</span></div>
|
|
{{ else if eq .ViewState.booking.Status.String "CONFIRMED"}}
|
|
<div class="mt-4"><span class="p-1 text-sm bg-co-green rounded-2xl px-4">Confirmé</span></div>
|
|
{{ else if eq .ViewState.booking.Status.String "CANCELLED"}}
|
|
<div class="mt-4"><span class="p-1 text-sm bg-co-red text-white rounded-2xl px-4">Annulé</span></div>
|
|
{{ end }}
|
|
|
|
<div class="mt-6 flex justify-end space-x-3">
|
|
{{if eq .ViewState.booking.Status.String "WAITING_DRIVER_CONFIRMATION" }}
|
|
<a href="/app/organized-carpool/bookings/{{.ViewState.booking.Id}}/confirm" class="inline-flex">
|
|
<button type="button" class="px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">
|
|
Confirmer
|
|
</button>
|
|
</a>
|
|
{{end}}
|
|
|
|
{{if ne .ViewState.booking.Status.String "WAITING_DRIVER_CONFIRMATION" }}
|
|
<a href="/app/organized-carpool/bookings/{{.ViewState.booking.Id}}/waitconfirmation" class="inline-flex">
|
|
<button type="button" class="px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">
|
|
Remettre en attente
|
|
</button>
|
|
</a>
|
|
{{end}}
|
|
|
|
{{if ne .ViewState.booking.Status.String "CANCELLED" }}
|
|
{{$dialog := "cancel"}}
|
|
<div x-data="{ {{ $dialog }}: false}">
|
|
<button @click="{{ $dialog }} = !{{ $dialog }}" type="button" class="bg-co-red border-gray-300 border px-4 py-2 text-white items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
|
|
Annuler
|
|
</button>
|
|
<div x-show="{{$dialog}}" class="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true">
|
|
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"></div>
|
|
|
|
<div class="fixed inset-0 z-10 overflow-y-auto">
|
|
<div class="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
|
|
|
|
<div class="relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all sm:my-8 sm:w-full max-w-lg sm:p-6">
|
|
<form method="POST" action="/app/organized-carpool/bookings/{{.ViewState.booking.Id}}/cancel">
|
|
<div class="mx-auto flex h-12 w-12 items-center justify-center rounded-co bg-co-blue text-white">
|
|
{{$.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}}
|
|
</div>
|
|
<div class="mt-3 text-center sm:mt-5">
|
|
<h3 class="text-lg font-medium leading-6 text-gray-900" id="modal-title">Annuler</h3>
|
|
<div class="mt-2">
|
|
<p class="text-sm text-gray-500">Êtes-vous sûr de vouloir annuler ce covoiturage ?</p>
|
|
</div>
|
|
</div>
|
|
<div class="mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2">
|
|
<button @click="{{$dialog}} = !{{$dialog}}" type="button" class="mt-3 inline-flex w-full justify-center rounded-l-2xl border border-gray-300 bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:col-start-1 sm:mt-0 sm:text-sm">Annuler</button>
|
|
<button type="submit" class="inline-flex w-full justify-center rounded-r-2xl border border-transparent bg-co-blue px-4 py-2 text-base font-medium text-white shadow-sm hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:col-start-2 sm:text-sm">Confirmer</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
|
|
<a href='/app/journeys/?departure={"type":"Feature","geometry":{"type":"Point","coordinates":[{{.ViewState.booking.PassengerPickupLng}},{{.ViewState.booking.PassengerPickupLat}}]},"properties":{"label":"{{.ViewState.booking.PassengerPickupAddress}}"}}&destination={"type":"Feature","geometry":{"type":"Point","coordinates":[{{.ViewState.booking.PassengerDropLng}},{{.ViewState.booking.PassengerDropLat}}]},"properties":{"label":"{{.ViewState.booking.PassengerDropAddress}}"}}&passengerid={{.ViewState.passenger.ID}}' class="inline-flex">
|
|
<button type="button" class="px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm bg-white text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">
|
|
Dupliquer
|
|
</button>
|
|
</a>
|
|
|
|
{{if eq .ViewState.booking.Status.String "CANCELLED" }}
|
|
<a href='/app/journeys/?departure={"type":"Feature","geometry":{"type":"Point","coordinates":[{{.ViewState.booking.PassengerPickupLng}},{{.ViewState.booking.PassengerPickupLat}}]},"properties":{"label":"{{.ViewState.booking.PassengerPickupAddress}}"}}&destination={"type":"Feature","geometry":{"type":"Point","coordinates":[{{.ViewState.booking.PassengerDropLng}},{{.ViewState.booking.PassengerDropLat}}]},"properties":{"label":"{{.ViewState.booking.PassengerDropAddress}}"}}&departuredate={{ timeFormat .ViewState.booking.PassengerPickupDate.AsTime "2006-01-02"}}&departuretime={{ timeFormat .ViewState.booking.PassengerPickupDate.AsTime "15:04"}}&passengerid={{.ViewState.passenger.ID}}&organized_carpool_exclude_driver={{.ViewState.driver.ID}}' class="inline-flex">
|
|
<button type="button" class="px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm bg-white text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">
|
|
Solliciter un autre conducteur
|
|
</button>
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="max-w-7xl mx-auto py-8 px-4 sm:px-6 md:px-8">
|
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
|
<!-- Booking Details -->
|
|
<div class="bg-white shadow overflow-hidden sm:rounded-lg">
|
|
<div class="px-4 py-5 sm:px-6">
|
|
<h3 class="text-lg leading-6 font-medium text-gray-900">Détails du covoiturage</h3>
|
|
<p class="mt-1 max-w-2xl text-sm text-gray-500">Informations sur le trajet</p>
|
|
</div>
|
|
<div class="border-t border-gray-200 px-4 py-5 sm:p-0">
|
|
<dl class="sm:divide-y sm:divide-gray-200">
|
|
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">Conducteur</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
<a class="text-co-blue" href="/app/organized-carpool/drivers/{{ .ViewState.driver.ID }}">{{ .ViewState.driver.Data.first_name }} {{ .ViewState.driver.Data.last_name }}</a>
|
|
</dd>
|
|
</div>
|
|
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">Passager</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
<a class="text-co-blue" href="/app/beneficiaries/{{ .ViewState.driver.ID }}">{{ .ViewState.passenger.Data.first_name }} {{ .ViewState.passenger.Data.last_name }}</a>
|
|
</dd>
|
|
</div>
|
|
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">Départ conducteur</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
{{ .ViewState.driverDepartureAddress }}
|
|
</dd>
|
|
</div>
|
|
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">Prise en charge passager</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
{{ .ViewState.booking.PassengerPickupAddress }}
|
|
</dd>
|
|
</div>
|
|
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">Dépose passager</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
{{ .ViewState.booking.PassengerDropAddress }}
|
|
</dd>
|
|
</div>
|
|
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">Arrivée conducteur</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
{{ if .ViewState.driverArrivalAddress }}
|
|
{{ .ViewState.driverArrivalAddress }}
|
|
{{ end }}
|
|
</dd>
|
|
</div>
|
|
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">Date et heure</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
{{ timeFormat .ViewState.booking.PassengerPickupDate.AsTime "02/01/2006 15:04" }}
|
|
</dd>
|
|
</div>
|
|
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">Prix (passager)</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
{{ if .ViewState.booking.Price }}
|
|
{{ if eq .ViewState.booking.Price.Type.String "FREE" }}
|
|
<span class="text-co-green font-medium">Gratuit</span>
|
|
{{ else if eq .ViewState.booking.Price.Type.String "PAYING" }}
|
|
<span class="font-medium">{{ printf "%.2f" (round2 .ViewState.booking.Price.Amount) }} {{ .ViewState.booking.Price.Currency }}</span>
|
|
{{ else }}
|
|
<span class="text-gray-500">Prix non défini</span>
|
|
{{ end }}
|
|
{{ else }}
|
|
<span class="text-gray-500">Prix non disponible</span>
|
|
{{ end }}
|
|
</dd>
|
|
</div>
|
|
{{if and .ViewState.booking.DriverCompensationAmount .ViewState.booking.DriverCompensationCurrency}}
|
|
{{if gt (round2 .ViewState.booking.DriverCompensationAmount) 0.0}}
|
|
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">Indemnité conducteur</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
<span class="font-medium">{{ printf "%.2f" (round2 .ViewState.booking.DriverCompensationAmount) }} {{ .ViewState.booking.DriverCompensationCurrency }}</span>
|
|
</dd>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|
|
{{if .ViewState.booking.Motivation}}
|
|
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
|
<dt class="text-sm font-medium text-gray-500">Motif</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
{{.ViewState.booking.Motivation}}
|
|
</dd>
|
|
</div>
|
|
{{end}}
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Map -->
|
|
<div class="bg-white shadow overflow-hidden sm:rounded-lg">
|
|
<div class="border-t border-gray-200 h-full">
|
|
<div class="h-full min-h-96">
|
|
{{ template "organized_carpool_map" .ViewState }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{ end }}
|