feat: badges et filtres statuts manuels dans les listes de réservations

This commit is contained in:
Arnaud Delcasse
2026-02-26 17:51:40 +01:00
parent 2f6a368523
commit 266dff039c
3 changed files with 32 additions and 0 deletions

View File

@@ -19,10 +19,16 @@
<div class="mt-2 grid grid-cols-1">
<select id="vehicles_status" name="status" class="col-start-1 row-start-1 w-full appearance-none rounded-md bg-white py-1.5 pr-8 pl-3 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-indigo-600 sm:text-sm/6 dark:bg-white/5 dark:text-white dark:outline-white/10 dark:*:bg-gray-800 dark:focus-visible:outline-co-blue" onchange="this.form.submit()">
<option></option>
{{if eq .ViewState.status_management "manual"}}
{{range .ViewState.status_options}}
<option value="{{index . "name"}}"{{if eq $.ViewState.filters.status (index . "name")}} selected{{end}}>{{index . "label"}}</option>
{{end}}
{{else}}
<option value="FORTHCOMING"{{if eq .ViewState.filters.status "FORTHCOMING"}} selected{{end}}>A venir</option>
<option value="ONGOING"{{if eq .ViewState.filters.status "ONGOING"}} selected{{end}}>En cours</option>
<option value="TERMINATED"{{if eq .ViewState.filters.status "TERMINATED"}} selected{{end}}>Terminé</option>
<option value="CANCELLED"{{if eq .ViewState.filters.status "CANCELLED"}} selected{{end}}>Annulé</option>
{{end}}
</select>
<svg viewBox="0 0 16 16" fill="currentColor" data-slot="icon" aria-hidden="true" class="pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-gray-500 sm:size-4 dark:text-gray-400">
<path d="M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" fill-rule="evenodd" />

View File

@@ -39,6 +39,19 @@
<span class="p-1 bg-black text-white text-xs font-bold rounded-xl" >
Retiré
</span>
{{else if and (eq $.ViewState.status_management "manual") (not .Deleted)}}
{{$manualStatus := .ManualStatus}}
{{range $.ViewState.status_options}}
{{if eq (index . "name") $manualStatus}}
{{if eq (index . "meta_status") "open"}}
<span class="p-1 px-2 text-xs bg-co-blue text-white font-bold rounded-xl">{{index . "label"}}</span>
{{else if eq (index . "meta_status") "active"}}
<span class="p-1 px-2 text-xs bg-co-green text-white font-bold rounded-xl">{{index . "label"}}</span>
{{else if eq (index . "meta_status") "closed"}}
<span class="p-1 px-2 text-xs bg-co-red text-white font-bold rounded-xl">{{index . "label"}}</span>
{{end}}
{{end}}
{{end}}
{{else if .Deleted}}
<span class="p-1 bg-black text-white text-xs font-bold rounded-xl" >
Annulé