solidarity-transport-dev

This commit is contained in:
Arnaud Delcasse 2025-06-04 07:59:55 +02:00
parent d487f8b387
commit b3f7105ddb
10 changed files with 57 additions and 6 deletions

View File

@ -1 +1 @@
{{ define "sms_template" }}[{{ .name }}] Un conducteur solidaire vient d'accepter votre trajet vers {{.address}} le {{.date}}. Son numéro : {{.phone_number}}.{{ end }}
{{ define "sms_template" }}[{{ .name }}] {{ .driver_first_name }} {{ .driver_last_name }} vient d'accepter votre trajet vers {{.address}} le {{.date}}.{{ end }}

View File

@ -40,6 +40,16 @@
</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">
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Profil validé</dt>
<dd class="mt-1 text-sm text-gray-900">
{{if beneficiaryValidatedProfile .ViewState.beneficiary .ViewState.documents}}
<span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Oui</span>
{{else}}
<span class="p-1 px-2 text-xs bg-co-red text-white rounded-2xl">Non</span>
{{end}}
</dd>
</div>
{{if .ViewState.beneficiary.Data.email}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Email</dt>

View File

@ -28,7 +28,7 @@
</div>
<div class="p-4 pb-8 flex">
{{range $itinerary.Legs }}
{{if or (or (eq .Mode "BUS") (eq .Mode "REGIONAL_FAST_RAIL")) (eq .Mode "REGIONAL_RAIL") }}
{{if or (or (or (eq .Mode "BUS") (eq .Mode "REGIONAL_FAST_RAIL")) (eq .Mode "REGIONAL_RAIL") (eq .Mode "COACH")) }}
<!--<span class="ml-2 px-2 py-1 text-sm text-gray-500 whitespace-nowrap">
{{.AgencyName}}
</span>-->

View File

@ -39,7 +39,7 @@
</li>
{{end}}
{{end}}
{{if eq .Mode "BUS"}}
{{if or (eq .Mode "BUS") (eq .Mode "COACH")}}
<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>

View File

@ -25,6 +25,10 @@
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Commentaire
</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">
&nbsp;
@ -33,7 +37,6 @@
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
{{ range .ViewState.driver_journeys }}
{{if lt .DriverDistance 250}}
{{ $driver := (index $.ViewState.solidarity_drivers .DriverId)}}
<tr>
@ -41,6 +44,13 @@
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .DriverDistance }} km</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .PassengerDistance }} km</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{if $driver.Data.other_properties}}{{ $driver.Data.other_properties.comment }}{{end}}</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
{{if solidarityDriverValidatedProfile $driver (solidarityDocuments $driver.ID) }}
<span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Oui</span>
{{else}}
<span class="p-1 px-2 text-xs bg-co-red text-white rounded-2xl">Non</span>
{{end}}
</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/solidarity-transport/drivers/{{$driver.ID}}/journeys/{{.Id}}">
@ -49,7 +59,6 @@
</td>
</tr>
{{ end }}
{{ end }}
</tbody>
</table>
{{end}}

View File

@ -59,7 +59,7 @@
<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">{{ .Data.phone_number }}</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
{{if and .Data.other_properties (and .Data.other_properties.last_subscription_date (gt .Data.other_properties.last_subscription_date "2025"))}}
{{if solidarityDriverValidatedProfile . (solidarityDocuments .ID) }}
<span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Oui</span>
{{else}}
<span class="p-1 px-2 text-xs bg-co-red text-white rounded-2xl">Non</span>

View File

@ -190,6 +190,16 @@
{{ else }}
<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">Profil validé</dt>
<dd class="mt-1 text-sm text-gray-900">
{{if beneficiaryValidatedProfile .passenger (beneficiaryDocuments .passenger.ID)}}
<span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Oui</span>
{{else}}
<span class="p-1 px-2 text-xs bg-co-red text-white rounded-2xl">Non</span>
{{end}}
</dd>
</div>
{{if .passenger.Data.email}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Email</dt>

View File

@ -42,6 +42,16 @@
</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">
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Profil validé</dt>
<dd class="mt-1 text-sm text-gray-900">
{{if solidarityDriverValidatedProfile .ViewState.driver .ViewState.documents}}
<span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Oui</span>
{{else}}
<span class="p-1 px-2 text-xs bg-co-red text-white rounded-2xl">Non</span>
{{end}}
</dd>
</div>
{{if .ViewState.driver.Data.email}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Email</dt>

View File

@ -42,6 +42,16 @@
class="p-2 mt-1 mb-4 focus:ring-co-blue focus:border-co-blue block shadow-sm sm:text-sm rounded-2xl bg-white m-auto" />
</div>
{{end}}
<div class="m-auto text-center">
<label for="motivation" class="block text-sm font-medium text-gray-700">Motif du trajet</label>
<select name="motivation" id="motivation"
class="p-2 mt-1 mb-4 focus:ring-co-blue focus:border-co-blue block shadow-sm sm:text-sm rounded-2xl bg-white m-auto">
<option value="Santé">Santé</option>
<option value="Insertion">Insertion</option>
<option value="Administratif">Administratif</option>
<option selected="selected" value="Autre">Autre&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
</select>
</div>
{{template "submit_with_sms"
dict "IconSet" .IconSet
"Viewstate" .ViewState

View File

@ -78,6 +78,8 @@
"headerText" "Validez le trajet"
"infoText" "Le message suivant sera envoyé à votre passager. Vous pouvez le personnaliser.")
"SMSState" (dict "name" (.ViewState.config.GetString "service_name")
"driver_first_name" .ViewState.driver.Data.first_name
"driver_last_name" .ViewState.driver.Data.last_name
"address" .ViewState.booking.Journey.PassengerDrop.Properties.label
"date" (.ViewState.booking.Journey.PassengerPickupDate.Format "02/01/2006 15:04")
"phone_number" .ViewState.driver.Data.phone_number)}}