solidarity carpool
This commit is contained in:
82
web/layouts/organized_carpool/_partials/bookings_list.html
Normal file
82
web/layouts/organized_carpool/_partials/bookings_list.html
Normal file
@@ -0,0 +1,82 @@
|
||||
|
||||
{{ define "carpool_bookings_list" }}
|
||||
{{if eq (len .ViewState.bookings) 0}}
|
||||
<div class="m-10 text-center text-gray-600">Aucun trajet déclaré</div>
|
||||
{{else}}
|
||||
<table class="min-w-full divide-y divide-gray-300 border-gray-300 border-t-1">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
Conducteur
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
Passager
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
Départ
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
Destination
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
Date
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
Statut
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 bg-white">
|
||||
{{range .ViewState.bookings}}
|
||||
<tr>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
<a class="text-co-blue" href="/app/organized-carpool/drivers/{{.DriverId}}">
|
||||
{{ (index $.ViewState.drivers_map .DriverId).Data.first_name }}
|
||||
{{ (index $.ViewState.drivers_map .DriverId).Data.last_name }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
<a class="text-co-blue" href="/app/beneficiaries/{{.PassengerId}}">
|
||||
{{ (index $.ViewState.passengers_map .PassengerId).Data.first_name }}
|
||||
{{ (index $.ViewState.passengers_map .PassengerId).Data.last_name }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{ .Journey.PassengerPickup.Properties.label }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{ .Journey.PassengerDrop.Properties.label }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{ .Journey.PassengerPickupDate.Format "02/01/2006 15:04" }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{ if eq .Status "WAITING_CONFIRMATION"}}
|
||||
<span class="p-1 text-xs bg-gray-300 rounded-xl">Attente confirmation</span>
|
||||
{{ else if eq .Status "VALIDATED"}}
|
||||
<span class="p-1 text-xs bg-co-green rounded-xl">Validé</span>
|
||||
{{ else if eq .Status "CANCELLED"}}
|
||||
<span class="p-1 text-xs bg-co-red text-white rounded-xl">Annulé</span>
|
||||
{{ end }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
<a class="text-co-blue" href="/app/organized-carpool/bookings/{{.Id}}">
|
||||
Voir
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,119 @@
|
||||
|
||||
{{define "driver_availabilities"}}
|
||||
|
||||
<div class="bg-white shadow sm:rounded-lg"
|
||||
x-data="{
|
||||
availabilitiesdialog: false
|
||||
}">
|
||||
<div class="px-4 py-5 sm:px-6">
|
||||
<h2 id="timeline-title" class="text-lg font-medium text-gray-900">Trajets</h2>
|
||||
</div>
|
||||
<div class="border-t border-gray-200 px-4">
|
||||
<div class="">
|
||||
{{ range .ViewState.trips }}
|
||||
{{$departure := index .Features 0}}
|
||||
{{$destination := index .Features 1}}
|
||||
<div class="my-10">
|
||||
<div class="flex flex-row my-2">
|
||||
{{range .ExtraMembers.properties.schedules}}
|
||||
<span class="p-1 text-xs mr-2 bg-co-blue text-white rounded-lg">
|
||||
{{ if eq .day "SUN"}}Dimanche
|
||||
{{ else if eq .day "MON"}}Lundi
|
||||
{{ else if eq .day "TUE"}}Mardi
|
||||
{{ else if eq .day "WED"}}Mercredi
|
||||
{{ else if eq .day "THU"}}Jeudi
|
||||
{{ else if eq .day "FRI"}}Vendredi
|
||||
{{ else if eq .day "SAT"}}Samedi
|
||||
{{ end }}
|
||||
{{.time_of_day}}
|
||||
|
||||
</span>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="flex flex-row">
|
||||
<div class="flex-1 text-sm">
|
||||
{{$departure.Properties.label}}
|
||||
</div>
|
||||
<div>
|
||||
{{$.IconSet.Icon "hero:outline/chevron-right" "h-5 w-5 mr-3"}}
|
||||
</div>
|
||||
<div class="flex-1 text-sm text-right">
|
||||
{{$destination.Properties.label}}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex-none text-sm text-right"><a class="text-co-blue" href="/app/organized-carpool/drivers/{{$.ViewState.driver.ID}}/trips/{{.ExtraMembers.id}}/delete">Supprimer</a></div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<button type="button" @click="availabilitiesdialog = !availabilitiesdialog"
|
||||
class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-blue my-4 px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:w-auto">
|
||||
{{$.IconSet.Icon "hero:outline/plus-circle" "h-5 w-5 mr-3"}}
|
||||
Ajouter un trajet
|
||||
</button>
|
||||
</div>
|
||||
<div class="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true"
|
||||
x-show="availabilitiesdialog">
|
||||
<div class="fixed inset-0 bg-gray-900 opacity-30 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 sm:max-w-sm sm:p-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">Ajouter un trajet</h3>
|
||||
<div class="mt-2">
|
||||
<p class="text-sm text-gray-500">Paramétrer un nouveau trajet du conducteur</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form method="POST" action="/app/organized-carpool/drivers/{{.ViewState.driver.ID}}/trips" class="my-4">
|
||||
<div class="my-8">
|
||||
|
||||
{{ $fieldName := "address_departure" }}
|
||||
{{ template "address_autocomplete" (dict "FieldName" $fieldName "Address" .ViewState.driver.Data.address "FieldLabel" "Départ") }}
|
||||
|
||||
</div>
|
||||
<div class="my-8">
|
||||
|
||||
{{ $fieldName := "address_destination" }}
|
||||
{{ template "address_autocomplete" (dict "FieldName" $fieldName "Address" .ViewState.driver.Data.address_destination "FieldLabel" "Destination") }}
|
||||
|
||||
</div>
|
||||
<div class="my-4">
|
||||
<input name="days.monday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Lundi
|
||||
<input name="days.tuesday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Mardi
|
||||
<input name="days.wednesday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Mercredi
|
||||
<input name="days.thursday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Jeudi
|
||||
<input name="days.friday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Vendredi
|
||||
<input name="days.saturday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Samedi
|
||||
<input name="days.sunday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Dimanche
|
||||
</div>
|
||||
<div class="my-4 inline-flex justify-items-center">
|
||||
<div class="p-1">Aller à :</div>
|
||||
<input type="time" id="outwardtime" name="outwardtime" value="08:00"
|
||||
class="shadow-sm focus:ring-co-blue focus:border-co-blue p-1 sm:text-sm border-gray-300 rounded-2xl" />
|
||||
|
||||
</div>
|
||||
<div class="my-4 inline-flex justify-items-center">
|
||||
<div class="p-1">Retour à :</div>
|
||||
<input type="time" id="returntime" name="returntime" value="18:00"
|
||||
class="shadow-sm focus:ring-co-blue focus:border-co-blue p-1 sm:text-sm border-gray-300 rounded-2xl" />
|
||||
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-6">
|
||||
<button type="submit" class="inline-flex w-full justify-center rounded-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:text-sm">Ajouter</button>
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-6">
|
||||
<button @click="availabilitiesdialog=false" type="button" class="inline-flex w-full justify-center max-w-xs bg-white hover:bg-gray-50 border-gray-300 border px-4 py-2 text-gray-700 items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Annuler</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
73
web/layouts/organized_carpool/_partials/drivers_list.html
Normal file
73
web/layouts/organized_carpool/_partials/drivers_list.html
Normal file
@@ -0,0 +1,73 @@
|
||||
|
||||
{{ define "carpool_drivers_list" }}
|
||||
<div class="sm:flex sm:items-center">
|
||||
<div class="sm:flex-auto">
|
||||
<p class="mt-2 text-sm text-gray-700"></p>
|
||||
</div>
|
||||
<div class="m-4 sm:ml-16 sm:flex-none">
|
||||
<!--<a href="/api/cache/{{.ViewState.CacheId}}/export">
|
||||
<button type="button"
|
||||
class="inline-flex items-center justify-center bg-white hover:bg-gray-50 border-gray-300 border px-4 py-2 text-gray-700 flex items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
|
||||
{{$.IconSet.Icon "hero:outline/document-arrow-down" "h-5 w-5 mr-3"}}
|
||||
Exporter
|
||||
</button>
|
||||
</a>-->
|
||||
<a href="/app/organized-carpool/drivers/create">
|
||||
<button type="button"
|
||||
class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-blue px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-ci-blue focus:ring-offset-2 sm:w-auto">
|
||||
{{$.IconSet.Icon "hero:outline/plus-circle" "h-5 w-5 mr-3"}}
|
||||
Ajouter un covoitureur solidaire
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<table class="min-w-full divide-y divide-gray-300 border-gray-300 border-t-1">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
Nom
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
Adresse départ
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
Adresse destination
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
Téléphone
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
Profil validé
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 bg-white">
|
||||
{{ range .ViewState.drivers }}
|
||||
<tr>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .Data.first_name }} {{ .Data.last_name }}</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{if .Data.address}}{{.Data.address.properties.label}}{{end}}</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{if .Data.address_destination}}{{.Data.address_destination.properties.label}}{{end}}</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .Data.phone_number }}</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
<span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Oui</span>
|
||||
</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
<a class="text-co-blue hover:text-co-blue"
|
||||
href="/app/organized-carpool/drivers/{{.ID}}">
|
||||
Voir
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ end }}
|
||||
271
web/layouts/organized_carpool/_partials/journey_preview.html
Normal file
271
web/layouts/organized_carpool/_partials/journey_preview.html
Normal file
@@ -0,0 +1,271 @@
|
||||
|
||||
{{define "journey_preview"}}
|
||||
<div class="col-span-1 bg-white rounded-2xl shadow divide-y divide-gray-200 flex flex-col">
|
||||
<div class="px-4 py-2 flex items-center justify-between flex-wrap sm:flex-nowrap">
|
||||
<div class="ml-4 mt-2 grid-cols-2">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900">Le trajet</h3>
|
||||
<h2 class="text-sm leading-6 font-medium text-gray-600">Informations sur le trajet</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 gap-6 sm:grid-cols-2">
|
||||
<div class="p-4 py-5 sm:px-6">
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Départ passager</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{(index .journey.Features 0).Properties.MustString "label"}}</dd>
|
||||
</div>
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Destination passager</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{(index .journey.Features 1).Properties.MustString "label"}}</dd>
|
||||
</div>
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Départ conducteur</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{(index .journey.Features 0).Properties.MustString "label"}}</dd>
|
||||
</div>
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Destination conducteur</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{(index .journey.Features 1).Properties.MustString "label"}}</dd>
|
||||
</div>
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Prix (passager)</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">0 EUR</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
<div id="map" class="w-full h-full"></div>
|
||||
<script>
|
||||
let protocol = new pmtiles.Protocol();
|
||||
maplibregl.addProtocol("pmtiles",protocol.tile);
|
||||
var map = new maplibregl.Map({
|
||||
container: 'map', // container id
|
||||
style: "/public/maps/protomaps-light/style.json",
|
||||
});
|
||||
|
||||
const geojsonPoints = {
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{{ json (index .journey.Features 0) }},
|
||||
{{ json (index .journey.Features 1) }},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
map.on('load', async () => {
|
||||
map.addSource('trip', {
|
||||
type: "geojson",
|
||||
data: {{ json (index .journey.Features 2) }}
|
||||
})
|
||||
map.addLayer({
|
||||
'id': 'trip',
|
||||
'type': 'line',
|
||||
'source': 'trip',
|
||||
'layout': {
|
||||
'line-join': 'round',
|
||||
'line-cap': 'round',
|
||||
},
|
||||
'paint': {
|
||||
'line-color': '#243887',
|
||||
'line-width': 3
|
||||
},
|
||||
});
|
||||
|
||||
map.addSource('points', {
|
||||
type: "geojson",
|
||||
data: geojsonPoints
|
||||
})
|
||||
map.addLayer({
|
||||
'id': 'points',
|
||||
'type': 'circle',
|
||||
'source': 'points',
|
||||
'paint': {
|
||||
'circle-color': '#243887',
|
||||
'circle-radius': 8
|
||||
},
|
||||
});
|
||||
var bbox=turf.bbox(geojsonPoints)
|
||||
map.fitBounds(bbox, { padding: 30 })
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-4 grid grid-cols-1 gap-6 sm:grid-cols-2">
|
||||
<div class="col-span-1 bg-white rounded-2xl shadow divide-y divide-gray-200 flex flex-col">
|
||||
<div class="px-4 py-2 flex items-center justify-between flex-wrap sm:flex-nowrap">
|
||||
<div class="ml-4 mt-2 grid-cols-2">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900">Conducteur</h3>
|
||||
<h2 class="text-sm leading-6 font-medium text-gray-600">{{.driver.Data.first_name}} {{.driver.Data.last_name}}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-200 px-4 py-5 sm:px-6">
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
|
||||
{{if .driver.Data.email}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Email</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{.driver.Data.email}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .driver.Data.phone_number}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Téléphone</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{.driver.Data.phone_number}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .driver.Data.birthdate}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Date de naissance</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{(timeFrom .driver.Data.birthdate).Format
|
||||
"02/01/2006"}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if and .driver.Data.gender (ne .driver.Data.gender "0")}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Genre</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{genderISO5218 .driver.Data.gender}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .driver.Data.address}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Adresse</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{.driver.Data.address.properties.label}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .driver.Data.file_number}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Numéro de dossier (CAF / Pole emploi)</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{.driver.Data.file_number}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-span-1 bg-white rounded-2xl shadow divide-y divide-gray-200 flex flex-col">
|
||||
<div class="px-4 py-2 flex items-center justify-between flex-wrap sm:flex-nowrap">
|
||||
<div class="ml-4 mt-2">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900">Passager</h3>
|
||||
<h2 class="text-sm leading-6 font-medium text-gray-600">{{if ne .passenger.ID "" }}{{.passenger.Data.first_name}} {{.passenger.Data.last_name}}{{end}}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-200 px-4 py-5 sm:px-6">
|
||||
{{if eq .passenger.ID ""}}
|
||||
<form method="GET">
|
||||
|
||||
<div x-data="{
|
||||
text: '',
|
||||
beneficiariesListOpen: false,
|
||||
beneficiaries: {{json .beneficiaries}},
|
||||
filteredBeneficiaries: (beneficiaries, text) => {
|
||||
if(text=='') {
|
||||
return beneficiaries
|
||||
}
|
||||
return beneficiaries.filter(b => b['data']['first_name'].toLowerCase().includes(text.toLowerCase()) || b['data']['last_name'].toLowerCase().includes(text.toLowerCase()))
|
||||
},
|
||||
fields: {
|
||||
beneficiaryid: {{if .search}}'{{.search.beneficiary.ID}}'{{else}}null{{end}},
|
||||
},
|
||||
selectbeneficiary(beneficiary) {
|
||||
this.fields.beneficiaryid = beneficiary.id
|
||||
this.text = beneficiary.data.first_name + ' ' + beneficiary.data.last_name
|
||||
this.beneficiariesListOpen = false
|
||||
},
|
||||
}">
|
||||
<input type="hidden" name="passengerid" x-model="fields.beneficiaryid">
|
||||
<label for="combobox" class="block text-sm font-medium text-gray-700">Selectionner un bénéficiaire</label>
|
||||
<div class="relative mt-1 mb-4">
|
||||
<input autocomplete="off" @focus="beneficiariesListOpen = true" x-model="text" id="combobox" type="text" class="w-full rounded-2xl border border-gray-300 bg-white py-2 pl-3 pr-12 shadow-sm focus:border-co-blue focus:outline-none focus:ring-1 focus:ring-co-blue sm:text-sm" role="combobox" aria-controls="options" aria-expanded="false">
|
||||
|
||||
<button @click="beneficiariesListOpen = ! beneficiariesListOpen" type="button" class="absolute inset-y-0 right-0 flex items-center rounded-r-2xl px-2 focus:outline-none">
|
||||
<!-- Heroicon name: solid/selector -->
|
||||
<svg class="h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<ul x-show="beneficiariesListOpen" class="absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-xl bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm" id="options" role="listbox">
|
||||
<!--
|
||||
Combobox option, manage highlight styles based on mouseenter/mouseleave and keyboard navigation.
|
||||
|
||||
Active: "text-white bg-indigo-600", Not Active: "text-gray-900"
|
||||
-->
|
||||
<template x-for="beneficiary in filteredBeneficiaries(beneficiaries, text)">
|
||||
<li @click="selectbeneficiary(beneficiary)" class="relative cursor-default hover:bg-gray-100 select-none py-2 pl-3 pr-9 text-gray-900" id="option-0" role="option" tabindex="-1">
|
||||
<!-- Selected: "font-semibold" -->
|
||||
<span class="truncate" x-text="beneficiary.data.first_name"></span> <span class="truncate" x-text="beneficiary.data.last_name"></span>
|
||||
|
||||
<!--
|
||||
Checkmark, only display for selected option.
|
||||
|
||||
Active: "text-white", Not Active: "text-indigo-600"
|
||||
-->
|
||||
<span class="absolute inset-y-0 right-0 flex items-center pr-4 text-co-blue">
|
||||
<!-- Heroicon name: solid/check -->
|
||||
<!-- <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" />
|
||||
</svg> -->
|
||||
</span>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<!-- More items... -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="inline-flex w-full justify-center max-w-xs bg-co-blue 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">
|
||||
Valider
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{{ else }}
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
|
||||
{{if .passenger.Data.email}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Email</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{.passenger.Data.email}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .passenger.Data.phone_number}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Téléphone</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{.passenger.Data.phone_number}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .passenger.Data.birthdate}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Date de naissance</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{(timeFrom .passenger.Data.birthdate).Format
|
||||
"02/01/2006"}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if and .passenger.Data.gender (ne .passenger.Data.gender "0")}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Genre</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{genderISO5218 .passenger.Data.gender}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .passenger.Data.address}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Adresse</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{.passenger.Data.address.properties.label}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .passenger.Data.file_number}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Numéro de dossier (CAF / Pole emploi)</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{.passenger.Data.file_number}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Compte mobilié (solde)</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{if .passenger.Data.wallet}}{{ .passenger.Data.wallet }}{{else}}0{{end}} EUR</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
178
web/layouts/organized_carpool/driver_create.html
Normal file
178
web/layouts/organized_carpool/driver_create.html
Normal file
@@ -0,0 +1,178 @@
|
||||
|
||||
{{ 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">Créer un covoitureur solidaire</h1>
|
||||
</div>
|
||||
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8 mt-8"
|
||||
x-data="{
|
||||
fields: {
|
||||
first_name: null,
|
||||
last_name: null,
|
||||
email: null,
|
||||
phone_number: null,
|
||||
birthdate: null,
|
||||
},
|
||||
rules: {
|
||||
first_name: ['required'],
|
||||
last_name: ['required'],
|
||||
email: ['required', 'email'],
|
||||
phone_number: ['required', 'regexMatch:^((\\+)33|0)[1-9](\\d{2}){4}$'],
|
||||
birthdate: ['required'],
|
||||
},
|
||||
formValidation: {
|
||||
valid: false,
|
||||
fields: {
|
||||
first_name: {valid: null},
|
||||
last_name: {valid: null},
|
||||
email: {valid: null},
|
||||
phone_number: {valid: null},
|
||||
birthdate: {valid: null},
|
||||
}
|
||||
},
|
||||
isFormValid: true,
|
||||
validate() {
|
||||
this.formValidation = Iodine.assert(this.fields, this.rules)
|
||||
},
|
||||
validateField(field) {
|
||||
this.formValidation.fields[field] = Iodine.assert(this.fields[field], this.rules[field])
|
||||
},
|
||||
submit(event) {
|
||||
this.validate()
|
||||
if(!this.formValidation.valid) {
|
||||
this.isFormValid = false
|
||||
event.preventDefault()
|
||||
}
|
||||
return this.formValidation.valid
|
||||
}
|
||||
}">
|
||||
<form class="space-y-6" method="POST" @submit="submit">
|
||||
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||
<div class="md:col-span-1">
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900">Informations obligatoires</h3>
|
||||
<p class="mt-1 text-sm text-gray-500">Informations personnelles obligatoires pour créer le conducteur</p>
|
||||
</div>
|
||||
<div class="mt-5 md:mt-0 md:col-span-2">
|
||||
<div class="grid grid-cols-6 gap-6">
|
||||
<div class="col-span-6 sm:col-span-3">
|
||||
<label for="first_name" class="block text-sm font-medium text-gray-700">Prénom</label>
|
||||
<input type="text" name="first_name" id="first_name" autocomplete="given-name"
|
||||
class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||
x-model="fields.first_name" @blur="validateField('first_name')"
|
||||
:class="formValidation.fields.first_name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-3">
|
||||
<label for="last_name" class="block text-sm font-medium text-gray-700">Nom</label>
|
||||
<input type="text" name="last_name" id="last_name" autocomplete="family-name"
|
||||
class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||
x-model="fields.last_name" @blur="validateField('last_name')"
|
||||
:class="formValidation.fields.last_name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-3">
|
||||
<label for="email" class="block text-sm font-medium text-gray-700">Email</label>
|
||||
<input type="text" name="email" id="email" autocomplete="email"
|
||||
class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||
x-model="fields.email" @blur="validateField('email')"
|
||||
:class="formValidation.fields.email.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-3">
|
||||
<label for="phone_number" class="block text-sm font-medium text-gray-700">Numéro de
|
||||
téléphone</label>
|
||||
<input type="text" name="phone_number" id="phone_number" autocomplete="phone" placeholder="+33612345678"
|
||||
class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||
x-model="fields.phone_number" @blur="validateField('phone_number')"
|
||||
:class="formValidation.fields.phone_number.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||
</div>
|
||||
|
||||
<div class="col-span-6 sm:col-span-3">
|
||||
<label for="birthdate" class="block text-sm font-medium text-gray-700">Date de
|
||||
naissance</label>
|
||||
<input type="date" name="birthdate" id="birthdate" autocomplete="birthdate" placeholder="JJ/MM/AAAA"
|
||||
class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
|
||||
x-model="fields.birthdate" @blur="validateField('birthdate')"
|
||||
:class="formValidation.fields.birthdate.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
|
||||
</div>
|
||||
{{ $fieldName := "address" }}
|
||||
{{ template "address_autocomplete" dict "FieldName" $fieldName "FieldLabel" "Adresse principale" }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||
<div class="md:col-span-1">
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900">Informations optionnelles</h3>
|
||||
<p class="mt-1 text-sm text-gray-500">Autres informations de profil optionnelles</p>
|
||||
</div>
|
||||
<div class="mt-5 space-y-6 md:mt-0 md:col-span-2">
|
||||
<div class="grid grid-cols-6 gap-6">
|
||||
{{ $fieldName2 := "address_destination" }}
|
||||
{{ template "address_autocomplete" dict "FieldName" $fieldName2 "FieldLabel" "Adresse destination" }}
|
||||
|
||||
<div class="col-span-6 sm:col-span-3">
|
||||
<label for="gender" class="block text-sm font-medium text-gray-700">Genre</label>
|
||||
<div class="sm:mt-0 sm:col-span-2">
|
||||
<select id="gender" name="gender" autocomplete="gender" x-model="gender"
|
||||
class="p-2 max-w-lg mt-1 block focus:ring-co-blue focus:border-co-blue w-full shadow-sm sm:max-w-xs sm:text-sm border-gray-300 rounded-2xl">
|
||||
<option value="0">Inconnu</option>
|
||||
<option value="1">Masculin</option>
|
||||
<option value="2">Féminin</option>
|
||||
<option value="9">Sans objet</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-span-3 sm:col-span-3">
|
||||
<label class="block text-sm font-medium text-gray-700"> Photo </label>
|
||||
<div class="mt-1 flex items-center space-x-5">
|
||||
<span class="inline-block h-12 w-12 rounded-co overflow-hidden bg-gray-100">
|
||||
{{.IconSet.Icon "img:profile-picture-placeholder" "h-full w-full"}}
|
||||
</span>
|
||||
<button type="button"
|
||||
class="bg-white py-2 px-3 border border-gray-300 rounded-2xl shadow-sm text-sm leading-4 font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
|
||||
Charger la photo
|
||||
</button>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
|
||||
<div class="md:grid md:grid-cols-3 md:gap-6">
|
||||
<div class="md:col-span-1">
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900">Paramètres</h3>
|
||||
<p class="mt-1 text-sm text-gray-500">Paramètres liés au conducteur, utiles pour exploiter les fonctionnalités de PARCOURSMOB</p>
|
||||
</div>
|
||||
<div class="mt-5 space-y-6 md:mt-0 md:col-span-2">
|
||||
|
||||
{{ $fieldName := "address" }}
|
||||
{{ template "address_autocomplete" dict "FieldName" $fieldName }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="flex justify-end">
|
||||
<p x-show="! isFormValid" class="px-4 py-2 text-sm text-co-red">Certains champs de sont pas valides.</p>
|
||||
<a href="/app/organized-carpool/">
|
||||
<button type="button"
|
||||
class="bg-white py-2 px-4 border border-gray-300 rounded-2xl shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Annuler</button>
|
||||
</a>
|
||||
<button type="submit"
|
||||
class="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-2xl text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
|
||||
Créer le covoitureur solidaire</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
139
web/layouts/organized_carpool/driver_display.html
Normal file
139
web/layouts/organized_carpool/driver_display.html
Normal file
@@ -0,0 +1,139 @@
|
||||
|
||||
{{define "content"}}
|
||||
<main class="py-10">
|
||||
<!-- Page header -->
|
||||
<div class="max-w-3xl mx-auto px-4 sm:px-6 md:flex md:items-center md:justify-between md:space-x-5 lg:max-w-7xl lg:px-8">
|
||||
<div class="flex items-center space-x-5">
|
||||
<div class="flex-shrink-0">
|
||||
<div class="relative">
|
||||
<img class="h-16 w-16 rounded-co" src="/app/beneficiaries/{{.ViewState.driver.ID}}/picture" alt="">
|
||||
<span class="absolute inset-0 shadow-inner rounded-full" aria-hidden="true"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-gray-900">{{.ViewState.driver.Data.first_name}}
|
||||
{{.ViewState.driver.Data.last_name}}</h1>
|
||||
<p class="text-sm font-medium text-gray-500">{{if .ViewState.driver.Metadata.created}}Ajouté le <time
|
||||
datetime="2022-07-25">{{.ViewState.driver.Metadata.created}}</time> par
|
||||
<a href="#" class="text-gray-900">Conseiller 1</a>{{end}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="mt-6 flex flex-col-reverse justify-stretch space-y-4 space-y-reverse sm:flex-row-reverse sm:justify-end sm:space-x-reverse sm:space-y-0 sm:space-x-3 md:mt-0 md:flex-row md:space-x-3">
|
||||
<!-- <button type="button"
|
||||
class="inline-flex items-center justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-2xl text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Supprimer</button> -->
|
||||
<!-- <a href="/app/solidarity-transport/drivers/{{.ViewState.driver.ID}}/update" class="inline-flex"><button type="button"
|
||||
class="w-full 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">Modifier</button></a>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8 max-w-3xl mx-auto grid grid-cols-1 gap-6 sm:px-6 lg:max-w-7xl lg:grid-flow-col-dense lg:grid-cols-3">
|
||||
<div class="space-y-6 lg:col-start-1 lg:col-span-2">
|
||||
<section aria-labelledby="driver-information-title">
|
||||
<div class="bg-white shadow sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:px-6">
|
||||
<h2 id="driver-information-title" class="text-lg leading-6 font-medium text-gray-900">
|
||||
Informations personnelles</h2>
|
||||
<p class="mt-1 max-w-2xl text-sm text-gray-500">Informations générales sur le conducteur solidaire.</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-200 px-4 py-5 sm:px-6">
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
|
||||
{{if .ViewState.driver.Data.email}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Email</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.driver.Data.email}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .ViewState.driver.Data.phone_number}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Téléphone</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.driver.Data.phone_number}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .ViewState.driver.Data.birthdate}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Date de naissance</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{(timeFrom .ViewState.driver.Data.birthdate).Format
|
||||
"02/01/2006"}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if and .ViewState.driver.Data.gender (ne .ViewState.driver.Data.gender "0")}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Genre</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{genderISO5218 .ViewState.driver.Data.gender}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .ViewState.driver.Data.address}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Adresse principale</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.driver.Data.address.properties.label}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .ViewState.driver.Data.address_destination}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Adresse destination</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.driver.Data.address_destination.properties.label}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section aria-labelledby="functionalities-title" x-data="{
|
||||
tab: 'documents',
|
||||
to(event) {
|
||||
this.tab = event.target.value
|
||||
}
|
||||
}">
|
||||
<div class="bg-white shadow sm:rounded-lg sm:overflow-hidden">
|
||||
<div class="divide-y divide-gray-200">
|
||||
<div>
|
||||
<div class="sm:hidden">
|
||||
<label for="tabs" class="sr-only">Select a tab</label>
|
||||
<select id="tabs" name="tabs" @change="to"
|
||||
class="block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">
|
||||
<!--<option value="notes">Notes</option>-->
|
||||
|
||||
<!-- <option value="journeys">Déplacements</option>
|
||||
|
||||
<option value="vehicles">Véhicules</option>
|
||||
|
||||
<option value="events">Dispositifs</option> -->
|
||||
|
||||
<option value="documents">Documents</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="hidden sm:block">
|
||||
<div class="border-b border-gray-200 pl-4">
|
||||
<nav class="-mb-px flex space-x-8" aria-label="Tabs">
|
||||
<!-- Current: "border-indigo-500 text-indigo-600", Default: "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300" -->
|
||||
<!--<a href="#" @click="tab = 'notes'"
|
||||
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||
:class="tab == 'notes' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||
Notes </a>-->
|
||||
|
||||
<a href="#" @click="tab = 'documents'"
|
||||
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||
:class="tab == 'documents' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||
Documents </a>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div x-show="tab == 'documents'">{{template "driver_files" .}}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<section class="lg:col-start-3 lg:col-span-1">
|
||||
{{template "driver_availabilities" .}}
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
{{end}}
|
||||
17
web/layouts/organized_carpool/journey.html
Normal file
17
web/layouts/organized_carpool/journey.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{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">Organiser le covoiturage</h1>
|
||||
</div>
|
||||
<div class="max-w-7xl mx-auto py-8 px-4 sm:px-6 md:px-8">
|
||||
{{template "journey_preview" (dict "journey" .ViewState.journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries)}}
|
||||
{{if ne .ViewState.passenger.ID ""}}
|
||||
<div class="max-w-7xl m-auto px-4 sm:px-6 md:px-8 flex justify-items-center">
|
||||
<form method="POST">
|
||||
<button class="w-100 bg-co-blue 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">
|
||||
Envoyer la mise en relation
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
48
web/layouts/organized_carpool/overview.html
Normal file
48
web/layouts/organized_carpool/overview.html
Normal file
@@ -0,0 +1,48 @@
|
||||
{{ 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>
|
||||
|
||||
<div class="bg-white shadow sm:rounded-lg sm:overflow-hidden my-4" x-data="{
|
||||
tab: 'drivers',
|
||||
to(event) {
|
||||
this.tab = event.target.value
|
||||
}
|
||||
}">
|
||||
<div class="divide-y divide-gray-200">
|
||||
<div>
|
||||
<div class="hidden sm:block">
|
||||
<div class="border-b border-gray-200 pl-4">
|
||||
<nav class="-mb-px flex space-x-8" aria-label="Tabs">
|
||||
<a href="#" @click="tab = 'drivers'"
|
||||
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||
:class="tab == 'drivers' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||
Covoitureurs solidaires </a>
|
||||
|
||||
<!--<a href="#" @click="tab = 'beneficiaries'"
|
||||
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||
:class="tab == 'beneficiaries' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||
Bénéficiaires </a>-->
|
||||
|
||||
<a href="#" @click="tab = 'trips'"
|
||||
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||
:class="tab == 'solidarityService' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||
Trajets </a>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div x-show="tab == 'drivers'">{{template "carpool_drivers_list" .}}</div>
|
||||
|
||||
|
||||
<div x-show="tab == 'beneficiaries'">1</div>
|
||||
<div x-show="tab == 'trips'">{{template "carpool_bookings_list" .}}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user