change sms

This commit is contained in:
2025-05-23 09:57:36 +02:00
parent 931783650f
commit 4bb249ef2a
16 changed files with 388 additions and 128 deletions

View File

@@ -21,18 +21,18 @@
<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 $itinerary.StartTime).Format "15:04"}} - {{(timeFrom $itinerary.EndTime).Format "15:04"}}
{{$itinerary.StartTime.Format "15:04"}} - {{$itinerary.EndTime.Format "15:04"}}
({{divideInt $itinerary.Duration 60}} Minutes)
</div>
<div></div>
</div>
<div class="p-4 pb-8 flex">
{{range $itinerary.Legs }}
{{if eq .Mode "BUS"}}
<span class="ml-2 px-2 py-1 text-sm text-gray-500 whitespace-nowrap">
{{if or (or (eq .Mode "BUS") (eq .Mode "REGIONAL_FAST_RAIL")) (eq .Mode "REGIONAL_RAIL") }}
<!--<span class="ml-2 px-2 py-1 text-sm text-gray-500 whitespace-nowrap">
{{.AgencyName}}
</span>
<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}}">
</span>-->
<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}}; color: #{{.RouteTextColor}}">
{{.RouteShortName}}
</span>
{{end}}

View File

@@ -2,15 +2,15 @@
{{ 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 class="flex-1">{{ .StartTime.Format "15:04" }} - {{ .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" }}
{{if .Distance}}
<li>
<div class="relative py-4">
{{if $firstwalk}}
@@ -24,21 +24,28 @@
</span>
</div>
<div class="flex min-w-0 flex-1 justify-between space-x-4 pt-1.5">
{{if .Distance}}
<div>
<p class="text-xs text-gray-500">Marcher <a href="#" class="font-medium text-gray-900">{{ .Distance }}m</a></p>
</div>
{{ else }}
<div>
<p class="text-xs text-gray-500">Attendre <a href="#" class="font-medium text-gray-900">{{ divideInt .Duration 60 }} minutes</a></p>
</div>
{{ end }}
</div>
</div>
</div>
</li>
{{end}}
{{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}}">
<span class="h-8 w-8 rounded-co bg-co-blue flex items-center justify-center ring-8 ring-white" style="background-color: #{{.RouteColor}}; color: #{{.RouteTextColor}}">
{{$.IconSet.Icon "tabler-icons:bus" "h-5 w-5 stroke-white"}}
</span>
</div>
@@ -62,6 +69,36 @@
</div>
</li>
{{end}}
{{if or (eq .Mode "REGIONAL_FAST_RAIL") (eq .Mode "REGIONAL_RAIL") }}
<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}}; color: #{{.RouteTextColor}}">
{{$.IconSet.Icon "tabler-icons:train" "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">TER {{.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>