parcoursmob-default-theme/web/layouts/journeys/_partials/journeys-carpool.html

56 lines
2.4 KiB
HTML

{{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}}