Improvements
This commit is contained in:
@@ -75,7 +75,7 @@
|
||||
{{ end }}
|
||||
</td>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||
{{ .Journey.Price.Amount }} {{ .Journey.Price.Currency }}
|
||||
{{ printf "%.2f" (round2 .Journey.Price.Amount) }} {{ .Journey.Price.Currency }}
|
||||
</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}}">
|
||||
|
||||
@@ -52,25 +52,25 @@
|
||||
<dt class="text-sm font-medium text-gray-500">Prix (passager)</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">
|
||||
{{if .pricing_result}}
|
||||
{{ printf "%.2f" .pricing_result.passenger.Amount }} {{.pricing_result.passenger.Currency}}
|
||||
{{ printf "%.2f" (round2 .pricing_result.passenger.Amount) }} {{.pricing_result.passenger.Currency}}
|
||||
{{else if .booking}}
|
||||
{{ printf "%.2f" .booking.Journey.Price.Amount }} {{.booking.Journey.Price.Currency}}
|
||||
{{ printf "%.2f" (round2 .booking.Journey.Price.Amount) }} {{.booking.Journey.Price.Currency}}
|
||||
{{else}}
|
||||
0.00 EUR
|
||||
{{end}}
|
||||
</dd>
|
||||
</div>
|
||||
{{if and .pricing_result .pricing_result.driver (gt .pricing_result.driver.Amount 0.0)}}
|
||||
{{if and .pricing_result .pricing_result.driver (gt (round2 .pricing_result.driver.Amount) 0.0)}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Indemnité conducteur</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ printf "%.2f" .pricing_result.driver.Amount }} {{.pricing_result.driver.Currency}}</dd>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ printf "%.2f" (round2 .pricing_result.driver.Amount) }} {{.pricing_result.driver.Currency}}</dd>
|
||||
</div>
|
||||
{{else if .booking}}
|
||||
{{if .booking.DriverCompensationAmount}}
|
||||
{{if gt . 0.0}}
|
||||
{{if gt (round2 .booking.DriverCompensationAmount) 0.0}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Indemnité conducteur</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ printf "%.2f" . }} {{.booking.DriverCompensationCurrency}}</dd>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ printf "%.2f" (round2 .booking.DriverCompensationAmount) }} {{.booking.DriverCompensationCurrency}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -272,7 +272,7 @@
|
||||
{{end}}
|
||||
<div class="sm:col-span-1">
|
||||
<dt class="text-sm font-medium text-gray-500">Compte mobilié (solde)</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ printf "%.2f" .passenger_wallet_balance }} EUR</dd>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ printf "%.2f" (round2 .passenger_wallet_balance) }} EUR</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
@@ -157,6 +157,22 @@
|
||||
{{end}}
|
||||
</dd>
|
||||
</div>
|
||||
{{if .ViewState.booking.Data.motivation}}
|
||||
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
||||
<dt class="text-sm font-medium text-gray-500">Motif</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
||||
{{$motivation := .ViewState.booking.Data.motivation}}
|
||||
{{$found := false}}
|
||||
{{range .ViewState.booking_motivations}}
|
||||
{{if eq .value $motivation}}
|
||||
{{.label}}
|
||||
{{$found = true}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if not $found}}{{$motivation}}{{end}}
|
||||
</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
||||
<dt class="text-sm font-medium text-gray-500">Distance passager</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
||||
@@ -172,27 +188,19 @@
|
||||
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
||||
<dt class="text-sm font-medium text-gray-500">Prix (passager)</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
||||
<span class="font-medium">{{ printf "%.2f" .ViewState.booking.Journey.Price.Amount }} {{ .ViewState.booking.Journey.Price.Currency }}</span>
|
||||
<span class="font-medium">{{ printf "%.2f" (round2 .ViewState.booking.Journey.Price.Amount) }} {{ .ViewState.booking.Journey.Price.Currency }}</span>
|
||||
</dd>
|
||||
</div>
|
||||
{{if .ViewState.booking.DriverCompensationAmount}}
|
||||
{{if gt .ViewState.booking.DriverCompensationAmount 0.0}}
|
||||
{{if gt (round2 .ViewState.booking.DriverCompensationAmount) 0.0}}
|
||||
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
||||
<dt class="text-sm font-medium text-gray-500">Indemnité conducteur</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
||||
<span class="font-medium">{{ printf "%.2f" .ViewState.booking.DriverCompensationAmount }} {{.ViewState.booking.DriverCompensationCurrency}}</span>
|
||||
<span class="font-medium">{{ printf "%.2f" (round2 .ViewState.booking.DriverCompensationAmount) }} {{.ViewState.booking.DriverCompensationCurrency}}</span>
|
||||
</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .ViewState.booking.Data.motivation}}
|
||||
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
||||
<dt class="text-sm font-medium text-gray-500">Motif</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
||||
{{ .ViewState.booking.Data.motivation }}
|
||||
</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -45,14 +45,9 @@
|
||||
<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="Administratif">Administratif (trajet garanti)</option>
|
||||
<option value="Commerce">Commerce</option>
|
||||
<option value="Courses">Courses</option>
|
||||
<option value="Insertion">Insertion (trajet garanti)</option>
|
||||
<option value="Loisirs">Loisirs</option>
|
||||
<option value="Visite à un proche">Visite à un proche</option>
|
||||
<option value="Santé">Santé (trajet garanti)</option>
|
||||
<option selected="selected" value="">Autre </option>
|
||||
{{range .ViewState.booking_motivations}}
|
||||
<option value="{{.value}}"{{if eq .value ""}} selected="selected"{{end}}>{{.label}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
</div>
|
||||
{{template "submit_with_sms"
|
||||
|
||||
Reference in New Issue
Block a user