Add history for solidarity transport and organized carpool
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
{{define "beneficiary_organized_carpool"}}
|
||||
<div class="py-6">
|
||||
{{if .ViewState.organized_carpool_stats}}
|
||||
<div class="py-5 text-center">
|
||||
<p class="text-lg">Trajets réalisés : {{ .ViewState.organized_carpool_stats.count }}</p>
|
||||
<p class="text-lg">Kilomètres réalisés : {{ .ViewState.organized_carpool_stats.km}} km</p>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="text-center py-5">
|
||||
<a href="/app/journeys/?passengerid={{.ViewState.beneficiary.ID}}" class="inline-flex">
|
||||
<button type="button" class="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">Chercher un trajet</button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{if .ViewState.organized_carpool_bookings}}
|
||||
<div class="py-5">
|
||||
<h4 class="text-lg font-medium text-gray-900 mb-4 text-center">Historique des covoiturages solidaires</h4>
|
||||
<table class="min-w-full divide-y divide-gray-300 border-gray-300 border-t-1">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Date</th>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Conducteur</th>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Départ</th>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Arrivée</th>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Statut</th>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 bg-white">
|
||||
{{range .ViewState.organized_carpool_bookings}}
|
||||
{{if or (eq .Status.String "CONFIRMED") (eq .Status.String "WAITING_DRIVER_CONFIRMATION")}}
|
||||
<tr>
|
||||
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{timeFormat .PassengerPickupDate.AsTime "02/01/2006 15:04"}}
|
||||
</td>
|
||||
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{if .Driver}}
|
||||
<a class="text-co-blue" href="/app/organized-carpool/drivers/{{.Driver.Id}}">
|
||||
{{ (index $.ViewState.organized_carpool_drivers_map .Driver.Id).Data.first_name }}
|
||||
{{ (index $.ViewState.organized_carpool_drivers_map .Driver.Id).Data.last_name }}
|
||||
</a>
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{.PassengerPickupAddress}}
|
||||
</td>
|
||||
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{.PassengerDropAddress}}
|
||||
</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{if eq .Status.String "CONFIRMED"}}
|
||||
<span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Confirmé</span>
|
||||
{{else if eq .Status.String "WAITING_DRIVER_CONFIRMATION"}}
|
||||
<span class="p-1 px-2 text-xs bg-gray-300 rounded-2xl">Attente confirmation</span>
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
<a class="text-co-blue" href="/app/organized-carpool/bookings/{{.Id}}">Voir</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="py-5">
|
||||
<p class="text-sm text-gray-500 text-center">Aucun covoiturage solidaire enregistré</p>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -1,10 +1,75 @@
|
||||
{{define "beneficiary_solidarity_transport"}}
|
||||
<div class="px-4 py-6 sm:px-6 text-center">
|
||||
<p class="text-center text-lg">Trajets réalisés : {{ .ViewState.solidarity_transport_stats.count }}</p>
|
||||
<p class="text-center text-lg">Kilomètres réalisés : {{ .ViewState.solidarity_transport_stats.km}} km</p>
|
||||
<div class="py-6">
|
||||
{{if .ViewState.solidarity_transport_stats}}
|
||||
<div class="py-5 text-center">
|
||||
<p class="text-lg">Trajets réalisés : {{ .ViewState.solidarity_transport_stats.count }}</p>
|
||||
<p class="text-lg">Kilomètres réalisés : {{ .ViewState.solidarity_transport_stats.km}} km</p>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<a href="/app/journeys/?passengerid={{.ViewState.beneficiary.ID}}" class="inline-flex">
|
||||
<button type="button" class="m-10 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">Chercher un trajet</button>
|
||||
</a>
|
||||
<div class="text-center py-5">
|
||||
<a href="/app/journeys/?passengerid={{.ViewState.beneficiary.ID}}" class="inline-flex">
|
||||
<button type="button" class="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">Chercher un trajet</button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{if .ViewState.solidarity_transport_bookings}}
|
||||
<div class="py-5">
|
||||
<h4 class="text-lg font-medium text-gray-900 mb-4 text-center">Historique des transports solidaires</h4>
|
||||
<table class="min-w-full divide-y divide-gray-300 border-gray-300 border-t-1">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Date</th>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Conducteur</th>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Départ</th>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Arrivée</th>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Statut</th>
|
||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 bg-white">
|
||||
{{range .ViewState.solidarity_transport_bookings}}
|
||||
{{if or (eq .Status "VALIDATED") (eq .Status "WAITING_CONFIRMATION")}}
|
||||
<tr>
|
||||
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{if .Journey}}
|
||||
{{timeFormat .Journey.PassengerPickupDate "02/01/2006 15:04"}}
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{if .DriverId}}
|
||||
<a class="text-co-blue" href="/app/solidarity-transport/drivers/{{.DriverId}}">
|
||||
{{ (index $.ViewState.solidarity_transport_drivers_map .DriverId).Data.first_name }}
|
||||
{{ (index $.ViewState.solidarity_transport_drivers_map .DriverId).Data.last_name }}
|
||||
</a>
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{if .Journey}}{{if .Journey.PassengerPickup}}{{.Journey.PassengerPickup.Properties.label}}{{end}}{{end}}
|
||||
</td>
|
||||
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{if .Journey}}{{if .Journey.PassengerDrop}}{{.Journey.PassengerDrop.Properties.label}}{{end}}{{end}}
|
||||
</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{if eq .Status "VALIDATED"}}
|
||||
<span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Validé</span>
|
||||
{{else if eq .Status "WAITING_CONFIRMATION"}}
|
||||
<span class="p-1 px-2 text-xs bg-gray-300 rounded-2xl">Attente confirmation</span>
|
||||
{{end}}
|
||||
</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
<a class="text-co-blue" href="/app/solidarity-transport/bookings/{{.Id}}">Voir</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="py-5">
|
||||
<p class="text-sm text-gray-500 text-center">Aucun transport solidaire enregistré</p>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
@@ -189,6 +189,12 @@
|
||||
Transport solidaire </a>
|
||||
{{end}}
|
||||
|
||||
{{if moduleAvailable "organized_carpool"}}
|
||||
<a href="#" @click="tab = 'organized_carpool'"
|
||||
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||
:class="tab == 'organized_carpool' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||
Covoiturage solidaire </a>
|
||||
{{end}}
|
||||
|
||||
<a href="#" @click="tab = 'organizations'"
|
||||
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||
@@ -208,6 +214,7 @@
|
||||
<div x-show="tab == 'notes'">{{template "beneficiary_notes" .}}</div>
|
||||
<div x-show="tab == 'wallet'">{{template "beneficiary_wallet" .}}</div>
|
||||
{{if moduleAvailable "solidarity_transport"}}<div x-show="tab == 'solidarity_transport'">{{template "beneficiary_solidarity_transport" .}}</div>{{end}}
|
||||
{{if moduleAvailable "organized_carpool"}}<div x-show="tab == 'organized_carpool'">{{template "beneficiary_organized_carpool" .}}</div>{{end}}
|
||||
<div x-show="tab == 'organizations'">{{template "beneficiary_organizations" .}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user