evol: filters on beneficiaries
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
dropLabel: '{{if .Journey}}{{ jsEscape .Journey.PassengerDrop.Properties.label }}{{end}}',
|
||||
pickupDate: '{{if .Journey}}{{ timeFormat .Journey.PassengerPickupDate "02/01/2006 15:04" }}{{end}}',
|
||||
status: '{{.Status}}',
|
||||
reason: {{ if .Data.reason }}'{{ jsEscape .Data.reason }}'{{ else }}''{{ end }},
|
||||
price: '{{if .Journey}}{{ printf "%.2f" (round2 .Journey.Price.Amount) }}{{end}}',
|
||||
currency: '{{if .Journey}}{{.Journey.Price.Currency}}{{end}}',
|
||||
motivation: {{ if .Data.motivation }}'{{ jsEscape .Data.motivation }}'{{ else }}''{{ end }},
|
||||
@@ -45,10 +46,10 @@
|
||||
goToPage(page) {
|
||||
this.currentPage = page;
|
||||
},
|
||||
getStatusBadge(status) {
|
||||
getStatusBadge(status, reason) {
|
||||
if (status === 'WAITING_CONFIRMATION') return { class: 'p-1 text-xs bg-gray-300 rounded-xl', text: 'Attente confirmation' };
|
||||
if (status === 'VALIDATED') return { class: 'p-1 text-xs bg-co-green rounded-xl', text: 'Validé' };
|
||||
if (status === 'CANCELLED') return { class: 'p-1 text-xs bg-co-red text-white rounded-xl', text: 'Annulé' };
|
||||
if (status === 'CANCELLED') return { class: 'p-1 text-xs bg-co-red text-white rounded-xl', text: reason ? 'Annulé : ' + reason : 'Annulé' };
|
||||
return { class: '', text: '' };
|
||||
},
|
||||
guaranteedMotivations: {{ json .ViewState.guaranteed_trip_motivations }},
|
||||
@@ -87,7 +88,7 @@
|
||||
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6" x-text="booking.dropLabel"></td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6" x-text="booking.pickupDate"></td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
<span :class="getStatusBadge(booking.status).class" x-text="getStatusBadge(booking.status).text"></span>
|
||||
<span :class="getStatusBadge(booking.status, booking.reason).class" x-text="getStatusBadge(booking.status, booking.reason).text"></span>
|
||||
<template x-if="booking.motivation && isGuaranteedTrip(booking.motivation)">
|
||||
<div class="mt-4">
|
||||
<span class="text-xs p-2 bg-co-green text-white rounded-2xl" x-text="'Trajet garanti : ' + booking.motivation"></span>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
dropLabel: '{{if .Journey}}{{ jsEscape .Journey.PassengerDrop.Properties.label }}{{end}}',
|
||||
pickupDate: '{{if .Journey}}{{ timeFormat .Journey.PassengerPickupDate "02/01/2006 15:04" }}{{end}}',
|
||||
status: '{{.Status}}',
|
||||
reason: {{ if .Data.reason }}'{{ jsEscape .Data.reason }}'{{ else }}''{{ end }},
|
||||
motivation: {{ if .Data.motivation }}'{{ jsEscape .Data.motivation }}'{{ else }}''{{ end }}
|
||||
}{{end}}
|
||||
],
|
||||
@@ -43,10 +44,10 @@
|
||||
goToPage(page) {
|
||||
this.currentPage = page;
|
||||
},
|
||||
getStatusBadge(status) {
|
||||
getStatusBadge(status, reason) {
|
||||
if (status === 'WAITING_CONFIRMATION') return { class: 'p-1 text-xs bg-gray-300 rounded-xl', text: 'Attente confirmation' };
|
||||
if (status === 'VALIDATED') return { class: 'p-1 text-xs bg-co-green rounded-xl', text: 'Validé' };
|
||||
if (status === 'CANCELLED') return { class: 'p-1 text-xs bg-co-red text-white rounded-xl', text: 'Annulé' };
|
||||
if (status === 'CANCELLED') return { class: 'p-1 text-xs bg-co-red text-white rounded-xl', text: reason ? 'Annulé : ' + reason : 'Annulé' };
|
||||
return { class: '', text: '' };
|
||||
},
|
||||
guaranteedMotivations: {{ json .ViewState.guaranteed_trip_motivations }},
|
||||
@@ -84,7 +85,7 @@
|
||||
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6" x-text="booking.dropLabel"></td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6" x-text="booking.pickupDate"></td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
<span :class="getStatusBadge(booking.status).class" x-text="getStatusBadge(booking.status).text"></span>
|
||||
<span :class="getStatusBadge(booking.status, booking.reason).class" x-text="getStatusBadge(booking.status, booking.reason).text"></span>
|
||||
<template x-if="booking.motivation && isGuaranteedTrip(booking.motivation)">
|
||||
<div class="mt-4">
|
||||
<span class="text-xs p-2 bg-co-green text-white rounded-2xl" x-text="'Trajet garanti : ' + booking.motivation"></span>
|
||||
|
||||
Reference in New Issue
Block a user