156 lines
		
	
	
		
			9.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
			
		
		
	
	
			156 lines
		
	
	
		
			9.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
{{define "content"}}
 | 
						|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
 | 
						|
    <div class="sm:flex sm:items-center">
 | 
						|
        <div class="sm:flex-auto">
 | 
						|
            <h1 class="text-2xl font-semibold text-gray-900">Liste des véhicules</h1>
 | 
						|
        </div>
 | 
						|
        <div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
 | 
						|
            <a href="/app/administration/">
 | 
						|
                <a href="/app/administration/stats/bookings">
 | 
						|
                    <button type="button"
 | 
						|
                        class="inline-flex items-center justify-center bg-white hover:bg-gray-50 border-gray-300 border px-4 py-2 text-gray-700 flex items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
 | 
						|
                        {{$.IconSet.Icon "hero:outline/document-arrow-left" "h-5 w-5 mr-3"}}
 | 
						|
                        Liste des réservations
 | 
						|
                    </button>
 | 
						|
                </a>
 | 
						|
                
 | 
						|
            </a>
 | 
						|
        </div>
 | 
						|
    </div>
 | 
						|
</div>
 | 
						|
 | 
						|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
 | 
						|
    <div class="mt-8 flex flex-col">
 | 
						|
        <div class="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
 | 
						|
            <div class="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
 | 
						|
                <div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg">
 | 
						|
                    <table class="min-w-full divide-y divide-gray-300">
 | 
						|
                        <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">
 | 
						|
                                    Statut Réservation
 | 
						|
                                </th>
 | 
						|
                                <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
						|
                                    Organisation
 | 
						|
                                </th>
 | 
						|
                                <th scope="col"
 | 
						|
                                    class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
						|
                                    Numéro (Immat / Bicycode)
 | 
						|
                                </th>
 | 
						|
                                <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
						|
                                    Type
 | 
						|
                                </th>
 | 
						|
                                <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
						|
                                    Modèle
 | 
						|
                                </th>
 | 
						|
                                <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
						|
                                    Lieu
 | 
						|
                                </th>
 | 
						|
                              
 | 
						|
                                <th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
 | 
						|
                                    <span class="sr-only">Actions</span>
 | 
						|
                                </th>
 | 
						|
                            </tr>
 | 
						|
                        </thead>
 | 
						|
                        <tbody class="divide-y divide-gray-200 bg-white">
 | 
						|
                            {{range .ViewState.vehicles}}
 | 
						|
 | 
						|
                            <tr>
 | 
						|
                                <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6 text-center">
 | 
						|
                                    <div class="flex flex-col px-6">
 | 
						|
                                    {{if not .Bookings}}
 | 
						|
                                    <span class="mt-1 p-1 bg-gray-500 text-white text-xs font-bold rounded-xl" >
 | 
						|
                                        Disponible
 | 
						|
                                    </span>
 | 
						|
                                    {{else if len .Bookings | eq 1}}
 | 
						|
                                        {{range .Bookings}}
 | 
						|
                                            {{if  .Data.administrator_unavailability}}
 | 
						|
                                                <span class="mt-1 p-1 bg-black text-white text-xs font-bold rounded-xl" >
 | 
						|
                                                    Retiré
 | 
						|
                                                </span>
 | 
						|
                                            {{else if eq .Status -1 }}
 | 
						|
                                                <span class="mt-1 p-1 bg-gray-500 text-white text-xs font-bold rounded-xl" >
 | 
						|
                                                    Disponible
 | 
						|
                                                </span>
 | 
						|
                                                {{else if eq .Status 1 }}
 | 
						|
                                                <span class="mt-1 p-1 bg-co-blue text-white text-xs font-bold rounded-xl" >
 | 
						|
                                                    A venir
 | 
						|
                                                </span>
 | 
						|
                                                {{else if eq .Status 0 }}
 | 
						|
                                                <span class="mt-1 p-1 bg-co-green text-white text-xs font-bold rounded-xl" >
 | 
						|
                                                    En cours
 | 
						|
                                                </span>
 | 
						|
                                            {{end}}
 | 
						|
                                        {{end}}
 | 
						|
                                    {{else if gt (len .Bookings) 1}} 
 | 
						|
                                        {{range .Bookings}}
 | 
						|
                                            {{if .Data.administrator_unavailability}}
 | 
						|
                                            <span class="mt-1 p-1 bg-black text-white text-xs font-bold rounded-xl" >
 | 
						|
                                                Retiré
 | 
						|
                                            </span>
 | 
						|
                                            {{else}}
 | 
						|
                                                {{if eq .Status 1 }}
 | 
						|
                                                <span class="mt-1 p-1 bg-co-blue text-white text-xs font-bold rounded-xl" >
 | 
						|
                                                    A venir
 | 
						|
                                                </span>
 | 
						|
                                                {{else if eq .Status 0 }}
 | 
						|
                                                <span class="mt-1 p-1 bg-co-green text-white text-xs font-bold rounded-xl" >
 | 
						|
                                                    En cours
 | 
						|
                                                </span>
 | 
						|
                                                {{end}}
 | 
						|
                                            {{end}}
 | 
						|
                                        {{end}}
 | 
						|
                                        {{$allAvailable := true}}
 | 
						|
                                            {{range .Bookings}}
 | 
						|
                                                {{if ne .Status -1}}
 | 
						|
                                                    {{ $allAvailable = false }}
 | 
						|
                                                    {{break}}
 | 
						|
                                                {{end}}
 | 
						|
                                            {{end}}
 | 
						|
                                            {{if $allAvailable}}
 | 
						|
                                                    <span class="mt-1 p-1 bg-gray-500 text-white text-xs font-bold rounded-xl" >
 | 
						|
                                                        Disponible
 | 
						|
                                                    </span>
 | 
						|
                                            {{end}}                                      
 | 
						|
                                    {{end}}
 | 
						|
                                    </div>
 | 
						|
                                </td>
 | 
						|
                                <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
						|
                                    <div class="text-gray-900" >{{(index $.ViewState.admingroups (index .Administrators 0)).Data.name}}</div>
 | 
						|
                                </td>
 | 
						|
                                <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
						|
                                    <div class="text-gray-900" >{{.Data.licence_plate}}</div>
 | 
						|
                                </td>
 | 
						|
                                <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
						|
                                    <div class="text-gray-900" >
 | 
						|
                                        {{.Type}}
 | 
						|
                                        {{if eq .Type "Voiture"}}
 | 
						|
                                        {{ if .Data.automatic}} (boite auto){{ end }}
 | 
						|
                                        {{end}}
 | 
						|
                                    </div>
 | 
						|
                                </td>
 | 
						|
                                <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
						|
                                    <div class="text-gray-900" >{{.Data.name}}</div>
 | 
						|
                                </td>
 | 
						|
                                <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
						|
                                    <div class="text-gray-900" >{{if .Data.address}}{{.Data.address.properties.label}}{{end}}</div>
 | 
						|
                                </td>
 | 
						|
                               
 | 
						|
                                <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
						|
                                    <a href="/app/vehicles-management/fleet/{{.ID}}"
 | 
						|
                                            class="text-co-blue hover:text-co-blue">Voir</a>
 | 
						|
                                </td>
 | 
						|
                            </tr>
 | 
						|
                            {{end}}
 | 
						|
                        </tbody>
 | 
						|
                    </table>
 | 
						|
                </div>
 | 
						|
            </div>
 | 
						|
        </div>
 | 
						|
    </div>
 | 
						|
</div>
 | 
						|
 | 
						|
 | 
						|
{{end}}
 |