Add public transit with MOTIS
This commit is contained in:
parent
ecac2f6c6f
commit
dc9df23c39
|
@ -23,4 +23,5 @@ To bundle Javascript with esbuild inside the web/ directory :
|
|||
|
||||
```
|
||||
npx esbuild assets/js/main.js --bundle --outfile=public/js/main.js
|
||||
```
|
||||
```
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ views:
|
|||
- web/layouts/journeys/_partials/journeys-all.html
|
||||
- web/layouts/journeys/_partials/journeys-others.html
|
||||
- web/layouts/journeys/_partials/journeys-carpool.html
|
||||
- web/layouts/journeys/_partials/journeys-public-transit.html
|
||||
- web/layouts/journeys/_partials/journeys-public-transit-motis.html
|
||||
- web/layouts/journeys/_partials/journeys-solidarity-transport.html
|
||||
- web/layouts/journeys/_partials/journeys-organized-carpools.html
|
||||
- web/layouts/journeys/search.html
|
||||
|
@ -353,6 +353,7 @@ views:
|
|||
icons:
|
||||
svg:
|
||||
coopgo:parcoursmob/monogram: <svg xmlns="http://www.w3.org/2000/svg" class="%s" viewBox="0 0 61.85 33.58"><defs><style>.cls-1{fill:#ff1300;}.cls-2{fill:#243887;}</style></defs><g id="Calque_2" data-name="Calque 2"><g id="Calque_1-2" data-name="Calque 1"><path class="cls-1" d="M44.978,0C31.337,0,28.1,6.824,27.875,15.505H39.536V9.434a.727.727,0,0,1,1.123-.607L52.6,16.453,40.659,24.08a.729.729,0,0,1-1.123-.608v-6.1H27.865c.075,8.427,1.527,16.213,17.113,16.213,14.867,0,16.872-7.764,16.872-17.032C61.85,7.91,59.894,0,44.978,0Z"/><polygon class="cls-1" points="41.412 21.385 49.133 16.453 41.412 11.521 41.412 21.385"/><path class="cls-2" d="M14.175,11.4l-.019,4.151H26.311a14.781,14.781,0,0,0,.819-5.141C27.046,3.767,22.545,0,14.764,0H1.052A1.147,1.147,0,0,0,0,1.24V31.87a1.149,1.149,0,0,0,1.094,1.239H11.525a1.145,1.145,0,0,0,1.051-1.239V10.41h.758C13.88,10.41,14.175,10.756,14.175,11.4Z"/><path class="cls-2" d="M14.148,17.3l-.015,3.514H18.97A7.521,7.521,0,0,0,25.458,17.3Z"/></g></g></svg>
|
||||
hero:outline/archive-box: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="%s"><path stroke-linecap="round" stroke-linejoin="round" d="m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z" /></svg>
|
||||
hero:outline/briefcase: <svg xmlns="http://www.w3.org/2000/svg" class="%s" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" /></svg>
|
||||
hero:outline/support: <svg xmlns="http://www.w3.org/2000/svg" class="%s" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="%s"><path stroke-linecap="round" stroke-linejoin="round" d="M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z" /></svg>
|
||||
hero:outline/group_module: <svg xmlns="http://www.w3.org/2000/svg" class="%s" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z" /></svg>
|
||||
|
@ -428,3 +429,8 @@ emails:
|
|||
files:
|
||||
- emails/layout.html
|
||||
- emails/onboarding/delete-subscriber.html
|
||||
|
||||
sms:
|
||||
solidarity_transport:
|
||||
request_driver:
|
||||
- sms/solidarity_transport/request_driver.tmpl
|
||||
|
|
|
@ -12,16 +12,18 @@
|
|||
<div>
|
||||
<h1 class="text-2xl font-bold text-gray-900">{{.ViewState.beneficiary.Data.first_name}}
|
||||
{{.ViewState.beneficiary.Data.last_name}}</h1>
|
||||
<p class="text-sm font-bold text-co-red">{{if .ViewState.beneficiary.Data.archived}}Bénéficiaire archivé{{end}}
|
||||
<p class="text-sm font-medium text-gray-500">{{if .ViewState.beneficiary.Metadata.created}}Ajouté le <time
|
||||
datetime="2022-07-25">{{.ViewState.beneficiary.Metadata.created}}</time> par
|
||||
<a href="#" class="text-gray-900">Conseiller 1</a>{{end}}
|
||||
datetime="2022-07-25">{{.ViewState.beneficiary.Metadata.created}}</time>{{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> -->
|
||||
{{if not .ViewState.beneficiary.Data.archived}}<a href="/app/beneficiaries/{{ .ViewState.beneficiary.ID }}/archive"><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">Archiver</button></a>{{end}}
|
||||
{{if .ViewState.beneficiary.Data.archived}}<a href="/app/beneficiaries/{{ .ViewState.beneficiary.ID }}/unarchive"><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">Désarchiver</button></a>{{end}}
|
||||
<a href="/app/beneficiaries/{{.ViewState.beneficiary.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>
|
||||
|
|
|
@ -14,6 +14,13 @@
|
|||
Exporter
|
||||
</button>
|
||||
</a>
|
||||
<a href="/app/beneficiaries/?archived=true">
|
||||
<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/archive-box" "h-5 w-5 mr-3"}}
|
||||
Bénéficiaires archivés
|
||||
</button>
|
||||
</a>
|
||||
<a href="/app/beneficiaries/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">
|
||||
|
|
|
@ -1,91 +1,47 @@
|
|||
{{define "journeys_all"}}
|
||||
<div>
|
||||
{{ if gt (len .ViewState.carpools) 0}}
|
||||
{{$carpool := (index .ViewState.carpools 0)}}
|
||||
<div class="px-4 pt-4 flex text-sm text-grey-900 font-bold">
|
||||
<div class="px-4 pt-4 flex text-sm text-grey-900">
|
||||
<div class="flex-1">
|
||||
{{.IconSet.Icon "tabler-icons:car" "h-6 w-6 inline-flex mr-4"}} Covoiturage
|
||||
{{if $carpool.days.monday}}
|
||||
entre {{$carpool.outward.monday.mintime}} et {{$carpool.outward.monday.maxtime}}
|
||||
{{else if $carpool.days.tuesday}}
|
||||
entre {{$carpool.outward.tuesday.mintime}} et {{$carpool.outward.tuesday.maxtime}}
|
||||
{{else if $carpool.days.wednesday}}
|
||||
entre {{$carpool.outward.wednesday.mintime}} et {{$carpool.outward.wednesday.maxtime}}
|
||||
{{else if $carpool.days.thursday}}
|
||||
entre {{$carpool.outward.thursday.mintime}} et {{$carpool.outward.thursday.maxtime}}
|
||||
{{else if $carpool.days.friday}}
|
||||
entre {{$carpool.outward.friday.mintime}} et {{$carpool.outward.friday.maxtime}}
|
||||
{{else if $carpool.days.saturday}}
|
||||
entre {{$carpool.outward.saturday.mintime}} et {{$carpool.outward.saturday.maxtime}}
|
||||
{{else if $carpool.days.sunday}}
|
||||
entre {{$carpool.outward.sunday.mintime}} et {{$carpool.outward.sunday.maxtime}}
|
||||
{{end}}
|
||||
(Temps trajet : {{divideFloat64 $carpool.duration 60.0 | printf "%.0f"}} Minutes)
|
||||
{{.IconSet.Icon "tabler-icons:car" "h-6 w-6 inline-flex mr-4"}}
|
||||
<span class=" font-bold">{{len .ViewState.carpools}} trajets disponibles</span> sur les applications de covoiturage.
|
||||
</div>
|
||||
<div>
|
||||
<span class="ml-2 rounded-xl px-2 py-1 bg-co-blue flex items-center justify-center ring-8 ring-white text-sm text-white whitespace-nowrap">
|
||||
RIDYGO
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-center text-sm my-4">
|
||||
<span class="ml-2 mt-1">
|
||||
{{$carpool.from.address}}, {{$carpool.from.city}}
|
||||
</span>
|
||||
{{$.IconSet.Icon "hero:outline/chevron-right" "h-3 w-3 stroke-gray-800 m-2"}}
|
||||
<span class="ml-2 mt-1">
|
||||
{{$carpool.to.address}}, {{$carpool.to.city}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="p-4 pb-8 flex items-center justify-center">
|
||||
<span class="text-xs text-md">Conducteur : </span>
|
||||
<span class="ml-2 mt-1 h-5 rounded-xl bg-gray-200 flex items-center justify-center ring-8 ring-white text-black p-2 text-sm">
|
||||
{{$carpool.driver.alias}}
|
||||
</span>
|
||||
<div></div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 text-center">
|
||||
<button class="rounded-xl text-md px-4 py-1 bg-gray-200 text-co-blue" @click="tab = 'carpool'">{{ len .ViewState.carpools}} solutions en covoiturage : les voir toutes</button>
|
||||
<button class="rounded-xl text-md px-4 py-1 bg-gray-200 text-co-blue" @click="tab = 'carpool'">Voir les trajets disponibles</button>
|
||||
</div>
|
||||
|
||||
|
||||
{{end}}
|
||||
|
||||
{{ if and .ViewState.journeys (gt (len .ViewState.journeys.Journeys) 0)}}
|
||||
<div class="px-4 pt-4 flex text-sm text-grey-900 font-bold border-t-2">
|
||||
{{ if and .ViewState.journeys (gt (len .ViewState.journeys) 0)}}
|
||||
{{$itinerary := index .ViewState.journeys 0}}
|
||||
<div class="px-4 pt-4 flex text-sm text-grey-900 font-bold">
|
||||
<div class="flex-1">
|
||||
{{.IconSet.Icon "tabler-icons:bus" "h-6 w-6 inline-flex mr-4"}}
|
||||
{{(timeFrom (index .ViewState.journeys.Journeys 0).Departure).Format "15:04"}} - {{(timeFrom (index .ViewState.journeys.Journeys 0).Arrival).Format "15:04"}}
|
||||
({{(index .ViewState.journeys.Journeys 0).Duration.Minutes | printf "%.0f"}} Minutes)
|
||||
{{( timeFrom $itinerary.StartTime).Format "15:04"}} - {{(timeFrom $itinerary.EndTime).Format "15:04"}}
|
||||
({{divideInt $itinerary.Duration 60}} Minutes)
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="p-4 pb-8 flex">
|
||||
{{$firstwalk := true}}
|
||||
{{range (index .ViewState.journeys.Journeys 0).Sections}}
|
||||
{{if eq .Type "street_network"}}
|
||||
<span class="ml-2 mt-1 h-5 w-5 rounded-co bg-gray-200 flex items-center justify-center ring-8 ring-white text-white">
|
||||
{{$.IconSet.Icon "tabler-icons:walk" "h-4 w-4 stroke-gray-800"}}
|
||||
{{range $itinerary.Legs }}
|
||||
{{if eq .Mode "BUS"}}
|
||||
<span class="ml-2 px-2 py-1 text-sm text-gray-500 whitespace-nowrap">
|
||||
{{.AgencyName}}
|
||||
</span>
|
||||
{{if $firstwalk}}
|
||||
{{$firstwalk = false}}
|
||||
{{$.IconSet.Icon "hero:outline/chevron-right" "h-3 w-3 stroke-gray-800 m-2"}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if eq .Type "public_transport"}}
|
||||
<span class="ml-2 rounded-xl px-2 py-1 bg-co-blue flex items-center justify-center ring-8 ring-white text-sm text-white whitespace-nowrap">
|
||||
{{if eq .Display.Network "Antibes - Envibus"}}Envibus{{else}}{{.Display.Network}}{{end}} Ligne {{.Display.Label}}
|
||||
<span class="ml-2 rounded-xl px-2 py-1 flex items-center justify-center ring-8 ring-white text-sm whitespace-nowrap" style="background-color: #{{.RouteColor}}">
|
||||
{{.RouteShortName}}
|
||||
</span>
|
||||
{{$.IconSet.Icon "hero:outline/chevron-right" "h-3 w-3 stroke-gray-800 m-2"}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
<div class="flex-1"></div>
|
||||
<button class="text-sm px-2 py-1 bg-gray-200 text-co-blue rounded-xl" @click="tab = 'public-transit'">Voir le détail</button>
|
||||
</div>
|
||||
<div class="p-4 text-center">
|
||||
<button class="rounded-xl text-md px-4 py-1 bg-gray-200 text-co-blue" @click="tab = 'public-transit'">{{ len .ViewState.journeys.Journeys}} solutions en transports en commun : les voir toutes</button>
|
||||
<button class="rounded-xl text-md px-4 py-1 bg-gray-200 text-co-blue" @click="tab = 'public-transit'">{{ len .ViewState.journeys}} solutions en transports en commun : les voir toutes</button>
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
{{define "journeys_carpool"}}
|
||||
|
||||
<div>
|
||||
{{ if eq (len .ViewState.carpools) 0}}
|
||||
<p class="p-12 text-gray-500 text-center text-md">Aucun covoiturage disponible pour ce trajet.</p>
|
||||
{{end}}
|
||||
|
||||
{{$first := true}}
|
||||
{{$i := 0}}
|
||||
{{range .ViewState.carpools}}
|
||||
{{if $first}}
|
||||
{{$first = false}}
|
||||
|
@ -13,44 +14,132 @@
|
|||
<div class="p-4 border-t-2 pb-8">
|
||||
{{end}}
|
||||
<div class="flex text-sm text-grey-900 font-bold">
|
||||
{{if .days.monday}}
|
||||
<div class="flex-1">Départ entre {{.outward.monday.mintime}} et {{.outward.monday.maxtime}}</div>
|
||||
{{else if .days.tuesday}}
|
||||
<div class="flex-1">Départ entre {{.outward.tuesday.mintime}} et {{.outward.tuesday.maxtime}}</div>
|
||||
{{else if .days.wednesday}}
|
||||
<div class="flex-1">Départ entre {{.outward.wednesday.mintime}} et {{.outward.wednesday.maxtime}}</div>
|
||||
{{else if .days.thursday}}
|
||||
<div class="flex-1">Départ entre {{.outward.thursday.mintime}} et {{.outward.thursday.maxtime}}</div>
|
||||
{{else if .days.friday}}
|
||||
<div class="flex-1">Départ entre {{.outward.friday.mintime}} et {{.outward.friday.maxtime}}</div>
|
||||
{{else if .days.saturday}}
|
||||
<div class="flex-1">Départ entre {{.outward.saturday.mintime}} et {{.outward.saturday.maxtime}}</div>
|
||||
{{else if .days.sunday}}
|
||||
<div class="flex-1">Départ entre {{.outward.sunday.mintime}} et {{.outward.sunday.maxtime}}</div>
|
||||
{{end}}
|
||||
<div>{{divideFloat64 .duration 60.0 | printf "%.0f"}} Minutes</div>
|
||||
<div class="flex-1">Trajet en covoiturage avec {{.ExtraMembers.ocss.Driver.Alias}}</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-center text-sm my-4">
|
||||
<!--{{if .ExtraMembers.ocss.PassengerPickupDate}}<div class="text-xs">Départ {{(timeFrom .ExtraMembers.ocss.PassengerPickupDate)}}</div>{{end}}-->
|
||||
<!--<div class="flex items-center justify-center text-sm my-4">
|
||||
<span class="ml-2 mt-1">
|
||||
{{.from.address}}, {{.from.city}}
|
||||
</span>
|
||||
{{$.IconSet.Icon "hero:outline/chevron-right" "h-3 w-3 stroke-gray-800 m-2"}}
|
||||
<span class="ml-2 mt-1">
|
||||
{{.to.address}}, {{.to.city}}
|
||||
</span>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="p-4 pb-8 flex items-center justify-center">
|
||||
<span class="text-xs text-md">Avec </span>
|
||||
<!--<span class="text-xs text-md">Avec </span>
|
||||
<span class="ml-2 mt-1 h-5 rounded-xl bg-gray-200 flex items-center justify-center ring-8 ring-white text-black p-2 text-sm">
|
||||
{{.driver.alias}}
|
||||
</span>
|
||||
</span>-->
|
||||
|
||||
<span class="text-xs text-md"> sur l'application </span>
|
||||
<span class="ml-2 rounded-xl px-2 py-1 bg-co-blue flex items-center justify-center ring-8 ring-white text-sm text-white whitespace-nowrap">
|
||||
RIDYGO
|
||||
Blablacar Daily
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<p class=" text-center text-xs">Accéder au trajet :<br /> <a href="{{.ExtraMembers.ocss.WebUrl}}" class="text-co-blue">{{.ExtraMembers.ocss.WebUrl}}</a></p>
|
||||
<div x-data="{dialog{{$i}}: false}" class="text-center">
|
||||
<button @click="dialog{{$i}} = !dialog{{$i}}" class="m-4 rounded-xl px-4 py-1 mt-8 bg-gray-200 text-co-blue text-sm">Envoyer le lien par SMS</button>
|
||||
<div x-show="dialog{{$i}}" class="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true">
|
||||
<form method="POST" action="">
|
||||
|
||||
<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">
|
||||
<div>
|
||||
<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">Envoyer un message</h3>
|
||||
<div class="mt-2">
|
||||
<p class="text-sm text-gray-500"></p>
|
||||
</div>
|
||||
<div>
|
||||
<label for="comment" class="block text-sm font-medium text-gray-700">Message</label>
|
||||
<div class="mt-1">
|
||||
<textarea rows="4" name="comment" id="comment" class="block w-full rounded-2xl border-gray-300 shadow-sm focus:border-co-blue focus:ring-co-blue sm:text-sm">Un covoiturage est disponible sur {{.ExtraMembers.ocss.WebUrl}}.</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br /><br />
|
||||
<div x-data="{
|
||||
text: '',
|
||||
beneficiariesListOpen: false,
|
||||
beneficiaries: {{json $.ViewState.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: null,
|
||||
},
|
||||
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>
|
||||
|
||||
|
||||
<div class="mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2">
|
||||
<button @click="dialog{{$i}} = !dialog{{$i}}" 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">Envoyer</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
{{ define "journeys_public_transit" }}
|
||||
{{ range .ViewState.journeys }}
|
||||
<div class="p-4 pb-8">
|
||||
<div class="flex text-md text-grey-900 font-bold">
|
||||
<div class="flex-1">{{ (timeFrom .StartTime).Format "15:04" }} - {{ (timeFrom .EndTime).Format "15:04" }}</div>
|
||||
<div>{{ divideInt .Duration 60 }} Minutes</div>
|
||||
</div>
|
||||
<div class="flow-root">
|
||||
|
||||
<ul role="list" class="-mb-8">
|
||||
{{$firstwalk := true}}
|
||||
{{range .Legs}}
|
||||
{{if eq .Mode "WALK" }}
|
||||
<li>
|
||||
<div class="relative py-4">
|
||||
{{if $firstwalk}}
|
||||
{{$firstwalk = false}}
|
||||
<span class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200" aria-hidden="true"></span>
|
||||
{{end}}
|
||||
<div class="relative flex space-x-3">
|
||||
<div>
|
||||
<span class="ml-2 h-4 w-4 rounded-co bg-gray-200 flex items-center justify-center ring-8 ring-white text-white">
|
||||
{{$.IconSet.Icon "tabler-icons:walk" "h-3 w-3 stroke-gray-800"}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex min-w-0 flex-1 justify-between space-x-4 pt-1.5">
|
||||
<div>
|
||||
<p class="text-xs text-gray-500">Marcher <a href="#" class="font-medium text-gray-900">{{ .Distance }}m</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{end}}
|
||||
{{if eq .Mode "BUS"}}
|
||||
<li>
|
||||
<div class="relative py-4">
|
||||
<span class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200" aria-hidden="true"></span>
|
||||
<div class="relative flex space-x-3">
|
||||
<div>
|
||||
<span class="h-8 w-8 rounded-co bg-co-blue flex items-center justify-center ring-8 ring-white" style="background-color: #{{.RouteColor}}">
|
||||
{{$.IconSet.Icon "tabler-icons:bus" "h-5 w-5 stroke-white"}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex min-w-0 flex-1 justify-between space-x-4 pt-1.5">
|
||||
<div>
|
||||
<p class="text-md text-gray-500">{{.AgencyName}} <a href="#" class="font-medium text-gray-900">Ligne {{.RouteShortName}}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-16 pt-2">
|
||||
<div>
|
||||
<p class="text-sm text-gray-500">Départ <a href="#" class="font-medium text-gray-900">{{.StartTime.Format "15:04"}}</a> - Arrivée <a href="#" class="font-medium text-gray-900">{{.EndTime.Format "15:04"}}</a></p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm text-gray-500">De <a href="#" class="font-medium text-gray-900">{{.From.Name}}</a> à <a href="#" class="font-medium text-gray-900">{{.To.Name}}</a></p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm text-gray-500">Direction <a href="#" class="font-medium text-gray-900">{{.Headsign}}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -6,13 +6,13 @@
|
|||
<p class="mt-2 text-sm text-gray-700"></p>
|
||||
</div>
|
||||
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
|
||||
<a href="/app/journeys/groups_covoiturage">
|
||||
<button type="button"
|
||||
<!--<a href="/app/journeys/groups_covoiturage">
|
||||
<border-gray-200utton 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-co-blue focus:ring-offset-2 sm:w-auto">
|
||||
{{$.IconSet.Icon "hero:outline/plus-circle" "h-5 w-5 mr-3"}}
|
||||
Gestion des groupes
|
||||
</button>
|
||||
</a>
|
||||
</a>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -12,6 +12,13 @@
|
|||
Exporter
|
||||
</button>
|
||||
</a>-->
|
||||
<a href="/app/organized-carpool/?archived=true">
|
||||
<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/archive-box" "h-5 w-5 mr-3"}}
|
||||
Covoitureurs archivés
|
||||
</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">
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<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-bold text-co-red">{{if .ViewState.driver.Data.archived}}Conducteur archivé{{end}}
|
||||
<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}}
|
||||
|
@ -21,6 +22,10 @@
|
|||
</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">
|
||||
{{if not .ViewState.driver.Data.archived}}<a href="/app/organized-carpool/drivers/{{ .ViewState.driver.ID }}/archive"><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">Archiver</button></a>{{end}}
|
||||
{{if .ViewState.driver.Data.archived}}<a href="/app/organized-carpool/drivers/{{ .ViewState.driver.ID }}/unarchive"><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">Désarchiver</button></a>{{end}}
|
||||
<!-- <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"
|
||||
|
|
|
@ -51,10 +51,10 @@
|
|||
{{ (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">
|
||||
<td class="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">
|
||||
<td class="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">
|
||||
|
|
|
@ -82,7 +82,7 @@ x-data="{
|
|||
{{end}}
|
||||
|
||||
<h3 class="text-lg">Ajouter un document</h3>
|
||||
<form method="POST" action="/app/drivers/{{.ViewState.driver.ID}}/documents" @submit="submit" enctype="multipart/form-data">
|
||||
<form method="POST" action="/app/solidarity-transport/drivers/{{.ViewState.driver.ID}}/documents" @submit="submit" enctype="multipart/form-data">
|
||||
<div class="md:grid md:grid-cols-6 p-2">
|
||||
<div class="sm:col-span-2">
|
||||
<label for="type" class="block text-sm font-medium text-gray-700">Type</label>
|
||||
|
@ -121,7 +121,9 @@ x-data="{
|
|||
|
||||
</div>
|
||||
<p class="text-xs text-gray-500">Jusqu'à 10MB</p>
|
||||
<p class="text-co-blue p-2" x-text="fields.file" x-if="fields.file"></p>
|
||||
<template x-if="fields.file">
|
||||
<p class="text-co-blue p-2" x-text="fields.file"></p>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -11,6 +11,13 @@
|
|||
Exporter
|
||||
</button>
|
||||
</a>-->
|
||||
<a href="/app/solidarity-transport/?archived=true">
|
||||
<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/archive-box" "h-5 w-5 mr-3"}}
|
||||
Conducteurs archivés
|
||||
</button>
|
||||
</a>
|
||||
<a href="/app/solidarity-transport/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">
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
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> -->
|
||||
{{if eq .ViewState.booking.Status "CANCELLED" }}
|
||||
<a href="/app/journeys/?departure={{json .ViewState.booking.Journey.PassengerPickup}}&destination={{ json .ViewState.booking.Journey.PassengerDrop }}&departuredate={{ .ViewState.booking.Journey.PassengerPickupDate.Format "2006-01-02"}}&departuretime={{ .ViewState.booking.Journey.PassengerPickupDate.Format "15:04"}}" class="inline-flex"><button type="button"
|
||||
class="w-full 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}}
|
||||
{{if eq .ViewState.booking.Status "WAITING_CONFIRMATION" }}
|
||||
<a href="/app/solidarity-transport/bookings/{{.ViewState.booking.Id}}/confirm" 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">Confirmer</button></a>
|
||||
|
|
|
@ -20,6 +20,10 @@
|
|||
</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">
|
||||
{{if not .ViewState.driver.Data.archived}}<a href="/app/solidarity-transport/drivers/{{ .ViewState.driver.ID }}/archive"><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">Archiver</button></a>{{end}}
|
||||
{{if .ViewState.driver.Data.archived}}<a href="/app/solidarity-transport/drivers/{{ .ViewState.driver.ID }}/unarchive"><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">Désarchiver</button></a>{{end}}
|
||||
<!-- <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"
|
||||
|
|
Loading…
Reference in New Issue