91 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
			
		
		
	
	
			91 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
| {{define "driver_availabilities"}}
 | |
| 
 | |
| <div class="bg-white shadow sm:rounded-lg"
 | |
|   x-data="{
 | |
|     availabilitiesdialog: false
 | |
|   }">
 | |
|   <div class="px-4 py-5 sm:px-6">
 | |
|     <h2 id="timeline-title" class="text-lg font-medium text-gray-900">Disponibilités</h2>
 | |
|   </div>
 | |
|   <div class="border-t border-gray-200 px-4">
 | |
|     <div class="py-4">
 | |
|       {{ range .ViewState.availabilities }}
 | |
|       <div class="flex flex-row">
 | |
|         <div class="flex-none">
 | |
|         {{ if eq .Day 0}}Dimanche
 | |
|         {{ else if eq .Day 1}}Lundi
 | |
|         {{ else if eq .Day 2}}Mardi
 | |
|         {{ else if eq .Day 3}}Mercredi
 | |
|         {{ else if eq .Day 4}}Jeudi
 | |
|         {{ else if eq .Day 5}}Vendredi
 | |
|         {{ else if eq .Day 6}}Samedi
 | |
|         {{ end }}
 | |
|         {{.StartTime}} - {{ .EndTime }}
 | |
|         </div>
 | |
|         <div class="flex-auto"> </div>
 | |
|         <div class="flex-none text-sm"><a class="text-co-blue" href="/app/solidarity-transport/drivers/{{$.ViewState.driver.ID}}/availabilities/{{.Id}}/delete">Supprimer</a></div>
 | |
|       </div>
 | |
|       {{ end }}
 | |
|     </div>
 | |
|     <button type="button" @click="availabilitiesdialog = !availabilitiesdialog" 
 | |
|       class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-blue my-4 px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-ci-blue focus:ring-offset-2 sm:w-auto">
 | |
|       {{$.IconSet.Icon "hero:outline/plus-circle" "h-5 w-5 mr-3"}}
 | |
|       Ajouter une disponibilité
 | |
|     </button>
 | |
|   </div>
 | |
|   <div class="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true"
 | |
|        x-show="availabilitiesdialog">
 | |
|     <div class="fixed inset-0 bg-gray-900 opacity-30 transition-opacity"></div>
 | |
|                                 
 | |
|     <div class="fixed inset-0 z-10 overflow-y-auto">
 | |
|       <div class="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
 | |
|         <div class="relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-sm sm:p-6">
 | |
|           <div>
 | |
|             <div class="mt-3 text-center sm:mt-5">
 | |
|               <h3 class="text-lg font-medium leading-6 text-gray-900" id="modal-title">Ajouter une disponibilité</h3>
 | |
|                 <div class="mt-2">
 | |
|                   <p class="text-sm text-gray-500">Paramétrer la nouvelle disponibilité du conducteur</p>
 | |
|                 </div>
 | |
|               </div>
 | |
|             </div>
 | |
|           <form method="POST" action="/app/solidarity-transport/drivers/{{.ViewState.driver.ID}}/availabilities" class="my-4">
 | |
|               <div class="my-8">
 | |
|                 
 | |
|                     {{ $fieldName := "address" }}
 | |
|                     {{ template "address_autocomplete" (dict "FieldName" $fieldName "Address" .ViewState.driver.Data.address) }}
 | |
| 
 | |
|               </div>
 | |
|               <div class="my-4">
 | |
|                 <input name="days.monday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Lundi   
 | |
|                 <input name="days.tuesday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Mardi   
 | |
|                 <input name="days.wednesday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Mercredi   
 | |
|                 <input name="days.thursday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Jeudi   
 | |
|                 <input name="days.friday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Vendredi   
 | |
|                 <input name="days.saturday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Samedi   
 | |
|                 <input name="days.sunday" type="checkbox" class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded"> Dimanche   
 | |
|               </div>
 | |
|               <div class="my-4 inline-flex justify-items-center">
 | |
|                 <div class="p-1">De</div>
 | |
|                 <input type="time" id="starttime" name="starttime" value="08:00"
 | |
|                        class="shadow-sm focus:ring-co-blue focus:border-co-blue p-1 sm:text-sm border-gray-300 rounded-l-2xl border-l-0">
 | |
|                 <div class="p-1 px-4">à</div>
 | |
|                 <input type="time" id="endtime" name="endtime" value="18:00"
 | |
|                        class="shadow-sm focus:ring-co-blue focus:border-co-blue p-1 sm:text-sm border-gray-300 rounded-r-2xl border-l-0">
 | |
|                 
 | |
|               </div>
 | |
|               <div class="mt-5 sm:mt-6">
 | |
|                 <button type="submit" class="inline-flex w-full justify-center rounded-2xl border border-transparent bg-co-blue px-4 py-2 text-base font-medium text-white shadow-sm hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:text-sm">Ajouter</button>
 | |
|               </div>
 | |
|               <div class="mt-5 sm:mt-6">
 | |
|                 <button @click="availabilitiesdialog=false" type="button" class="inline-flex w-full justify-center max-w-xs bg-white hover:bg-gray-50 border-gray-300 border px-4 py-2 text-gray-700 items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Annuler</button>
 | |
|               </div>
 | |
|             </form>
 | |
|           </div>
 | |
|         </div>
 | |
|       </div>
 | |
|     </div>
 | |
|   </div>
 | |
|  </div>
 | |
| 
 | |
| {{end}}
 |