pagination + optionsl vehicles fields
This commit is contained in:
@@ -170,26 +170,37 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<section aria-labelledby="timeline-title" class="lg:col-start-3 lg:col-span-1">
|
||||
<div class="bg-white px-4 py-5 shadow sm:rounded-lg sm:px-6">
|
||||
<h2 id="timeline-title" class="text-lg font-medium text-gray-900">Réservations à venir</h2>
|
||||
{{if eq (len .ViewState.vehicle.Bookings) 0}}
|
||||
<p class="p-12 text-gray-500 text-center text-md">Aucune réservation à venir</p>
|
||||
{{end}}
|
||||
<ul role="list" class="divide-y divide-gray-200">
|
||||
{{range .ViewState.vehicle.Bookings}}
|
||||
<li class="py-4 flex">
|
||||
<div class="ml-3">
|
||||
<a href="/app/vehicles-management/bookings/{{.ID}}" class="hover:bg-gray-200">
|
||||
<p class="text-sm font-medium text-gray-900">Du {{(timeFrom .Startdate).Format "02/01/2006"}} au {{(timeFrom .Enddate).Format "02/01/2006"}}</p>
|
||||
<p class="text-sm text-gray-500"></p>
|
||||
</a>
|
||||
{{if .ViewState.vehicle_optional_fields}}
|
||||
<section aria-labelledby="vehicle-other-properties-title" class="lg:col-start-3 lg:col-span-1">
|
||||
<div class="bg-white shadow sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:px-6">
|
||||
<h2 id="vehicle-other-properties-title" class="text-lg leading-6 font-medium text-gray-900">Autres propriétés</h2>
|
||||
<p class="mt-1 max-w-2xl text-sm text-gray-500">Informations complémentaires sur le véhicule</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-200 px-4 py-5 sm:px-6">
|
||||
<dl class="space-y-4">
|
||||
{{range .ViewState.vehicle_optional_fields}}
|
||||
{{if index $.ViewState.vehicle.Data .name}}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">{{.label}}</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">
|
||||
{{if eq .type "select"}}
|
||||
{{$fieldValue := index $.ViewState.vehicle.Data .name}}
|
||||
{{range .options}}
|
||||
{{if eq .value $fieldValue}}{{.label}}{{end}}
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{index $.ViewState.vehicle.Data .name}}
|
||||
{{end}}
|
||||
</dd>
|
||||
</div>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{end}}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user