Initial commit
This commit is contained in:
105
web/layouts/journeys/_partials/journeys-all.html
Normal file
105
web/layouts/journeys/_partials/journeys-all.html
Normal file
@@ -0,0 +1,105 @@
|
||||
{{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="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)
|
||||
</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 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>
|
||||
</div>
|
||||
|
||||
|
||||
{{end}}
|
||||
|
||||
{{ if gt (len .ViewState.journeys.Journeys) 0}}
|
||||
<div class="px-4 pt-4 flex text-sm text-grey-900 font-bold border-t-2">
|
||||
<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)
|
||||
</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"}}
|
||||
</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>
|
||||
{{$.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>
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
|
||||
<!--VEHICLES-->
|
||||
<div class="px-4 pt-16 flex text-sm text-grey-900 border-t-2">
|
||||
<div class="flex-1">
|
||||
{{.IconSet.Icon "tabler-icons:car" "h-6 w-6 inline-flex mr-4"}}
|
||||
<span class=" font-bold">{{len .ViewState.vehicles}} véhicules</span> partagés disponibles ce jour là et la semaine suivante
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="p-4 text-center">
|
||||
<a href="/app/vehicles/"><button class="text-md px-4 py-1 bg-gray-200 text-co-blue rounded-xl">Réserver un véhicule</button></a>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
56
web/layouts/journeys/_partials/journeys-carpool.html
Normal file
56
web/layouts/journeys/_partials/journeys-carpool.html
Normal file
@@ -0,0 +1,56 @@
|
||||
{{define "journeys_carpool"}}
|
||||
|
||||
{{ 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}}
|
||||
{{range .ViewState.carpools}}
|
||||
{{if $first}}
|
||||
{{$first = false}}
|
||||
<div class="p-4 pb-8">
|
||||
{{else}}
|
||||
<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>
|
||||
<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 class="p-4 pb-8 flex items-center justify-center">
|
||||
<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 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
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
38
web/layouts/journeys/_partials/journeys-others.html
Normal file
38
web/layouts/journeys/_partials/journeys-others.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{{define "journeys_others"}}
|
||||
|
||||
<!--VEHICLES-->
|
||||
<div class="p-4 flex text-sm text-grey-900">
|
||||
<div class="flex-1">
|
||||
{{.IconSet.Icon "tabler-icons:car" "h-6 w-6 inline-flex mr-4"}}
|
||||
<span class=" font-bold">{{len .ViewState.vehicles}} véhicules</span> partagés disponibles ce jour là et la semaine suivante
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<table class="min-w-full divide-y divide-gray-300">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 md:pl-0">Véhicule</th>
|
||||
<th scope="col" class="py-3.5 px-3 text-left text-sm font-semibold text-gray-900">Numéro</th>
|
||||
<th scope="col" class="py-3.5 px-3 text-left text-sm font-semibold text-gray-900">Gestionnaire</th>
|
||||
<th scope="col" class="py-3.5 px-3 text-left text-sm font-semibold text-gray-900">Lieu</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200">
|
||||
{{range .ViewState.vehicles}}
|
||||
<tr>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 md:pl-0">{{.Data.name}}</td>
|
||||
<td class="whitespace-nowrap py-4 px-3 text-sm text-gray-500">{{.Data.licence_plate}}</td>
|
||||
<td class="whitespace-nowrap py-4 px-3 text-sm text-gray-500">COOPGO</td>
|
||||
<td class="whitespace-nowrap py-4 px-3 text-sm text-gray-500">{{if .Data.address}}{{.Data.address.properties.label}}{{end}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="p-4 text-center">
|
||||
<a href="/app/vehicles/"><button class="text-md px-4 py-1 bg-gray-200 text-co-blue rounded-xl">Réserver un véhicule</button></a>
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
81
web/layouts/journeys/_partials/journeys-public-transit.html
Normal file
81
web/layouts/journeys/_partials/journeys-public-transit.html
Normal file
@@ -0,0 +1,81 @@
|
||||
{{define "journeys_public_transit"}}
|
||||
|
||||
{{ if eq (len .ViewState.journeys.Journeys) 0}}
|
||||
<p class="p-12 text-gray-500 text-center text-md">Aucun transport en commun pour ce trajet.</p>
|
||||
{{end}}
|
||||
|
||||
{{$first := true}}
|
||||
{{range .ViewState.journeys.Journeys}}
|
||||
{{if $first}}
|
||||
{{$first = false}}
|
||||
<div class="p-4 pb-8">
|
||||
{{else}}
|
||||
<div class="p-4 border-t-2 pb-8">
|
||||
{{end}}
|
||||
<div class="flex text-md text-grey-900 font-bold">
|
||||
<div class="flex-1">{{(timeFrom .Departure).Format "15:04"}} - {{(timeFrom .Arrival).Format "15:04"}}</div>
|
||||
<div>{{.Duration.Minutes | printf "%.0f"}} Minutes</div>
|
||||
</div>
|
||||
<div class="flow-root">
|
||||
|
||||
<ul role="list" class="-mb-8">
|
||||
{{$firstwalk := true}}
|
||||
{{range .Sections}}
|
||||
{{if eq .Type "street_network"}}
|
||||
<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">{{walkingLength .}}m</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{end}}
|
||||
{{if eq .Type "public_transport"}}
|
||||
<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">
|
||||
{{$.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">{{if eq .Display.Network "Antibes - Envibus"}}Envibus{{else}}{{.Display.Network}}{{end}} <a href="#" class="font-medium text-gray-900">Ligne {{.Display.Label}}</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">{{(timeFrom .Departure).Format "15:04"}}</a> - Arrivée <a href="#" class="font-medium text-gray-900">{{(timeFrom .Arrival).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">{{.Display.Direction}}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user