parcoursmob-default-theme/web/layouts/vehicles_management/fleet-display.html

90 lines
5.7 KiB
HTML

{{define "content"}}
<main class="py-10">
<div class="max-w-3xl mx-auto px-4 sm:px-6 md:flex md:items-center md:justify-between md:space-x-5 lg:max-w-7xl lg:px-8">
<div class="flex items-center space-x-5">
<!-- <div class="flex-shrink-0">
<div class="relative">
<img class="h-16 w-16 rounded-co" src="/app/beneficiaries/{{.ViewState.ID}}/picture" alt="">
<span class="absolute inset-0 shadow-inner rounded-full" aria-hidden="true"></span>
</div>
</div> -->
<div>
<h1 class="text-2xl font-bold text-gray-900">{{.ViewState.vehicle.Data.name}}</h1>
</div>
</div>
<div
class="mt-6 flex flex-col-reverse justify-stretch space-y-4 space-y-reverse sm:flex-row-reverse sm:justify-end sm:space-x-reverse sm:space-y-0 sm:space-x-3 md:mt-0 md:flex-row md:space-x-3">
<button type="button"
class="inline-flex items-center justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-2xl text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Retirer de la flotte</button>
<a href="/app/vehicles-management/fleet/{{.ViewState.vehicle.ID}}/update" class="inline-flex"><button type="button"
class="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">Modifier</button></a>
</div>
</div>
<div class="mt-8 max-w-3xl mx-auto grid grid-cols-1 gap-6 sm:px-6 lg:max-w-7xl lg:grid-flow-col-dense lg:grid-cols-3">
<div class="space-y-6 lg:col-start-1 lg:col-span-2">
<section aria-labelledby="vehicle-information-title">
<div class="bg-white shadow sm:rounded-lg">
<div class="px-4 py-5 sm:px-6">
<h2 id="vehicle-information-title" class="text-lg leading-6 font-medium text-gray-900">Informations</h2>
<p class="mt-1 max-w-2xl text-sm text-gray-500">Informations sur le véhicule</p>
</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">
{{if .ViewState.vehicle.Data.type}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Type</dt>
<dd class="mt-1 text-sm text-gray-900">{{if eq .ViewState.vehicle.Data.type "electric_bike"}}Vélo électrique{{else}}Voiture{{end}}</dd>
</div>
{{else}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Type</dt>
<dd class="mt-1 text-sm text-gray-900">Voiture</dd>
</div>
{{end}}
{{if .ViewState.vehicle.Data.licence_plate}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Numéro (Immatriculation, bicycode, ...)</dt>
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.vehicle.Data.licence_plate}}</dd>
</div>
{{end}}
{{if .ViewState.vehicle.Data.address}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Lieu</dt>
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.vehicle.Data.address.properties.label}}</dd>
</div>
{{end}}
{{if .ViewState.vehicle.Data.informations}}
<div class="sm:col-span-2">
<dt class="text-sm font-medium text-gray-500">Informations pratiques pour le bénéficiaire</dt>
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.vehicle.Data.informations}}</dd>
</div>
{{end}}
</div>
</div>
</section>
</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>
</div>
</li>
{{end}}
</ul>
{{template "calendar" .}}
</div>
</section>
</div>
</main>
{{end}}