add optional min=0 field; add time for starting time
This commit is contained in:
		| @@ -24,9 +24,9 @@ | |||||||
|     <div class="h-8"></div> |     <div class="h-8"></div> | ||||||
| {% endmacro header %} | {% endmacro header %} | ||||||
|  |  | ||||||
| {% macro input(label, name, type, required=false, class='rounded-md', value='') %} | {% macro input(label, name, type, required=false, class='rounded-md', value='', min='') %} | ||||||
|   <label for="{{ name }}" class="sr-only">{{ label }}</label> |   <label for="{{ name }}" class="sr-only">{{ label }}</label> | ||||||
|   <input id="{{ name }}" name="{{ name }}" type="{{ type }}" {% if required %} required {% endif %} value="{{ value }}" class="input {{ class }}" placeholder="{{ label }}"> |   <input id="{{ name }}" name="{{ name }}" type="{{ type }}" {% if required %} required {% endif %} value="{{ value }}" class="input {{ class }}" placeholder="{{ label }}" {% if min %} min="{{ min }}" {% endif %}> | ||||||
| {% endmacro input %} | {% endmacro input %} | ||||||
|  |  | ||||||
| {% macro checkbox(label, name, id='', checked=false) %} | {% macro checkbox(label, name, id='', checked=false) %} | ||||||
|   | |||||||
| @@ -193,7 +193,7 @@ | |||||||
|             <div class="bg-gray-100 p-3 mt-4 rounded-md"> |             <div class="bg-gray-100 p-3 mt-4 rounded-md"> | ||||||
|               <h3 class="text-primary-950 font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3> |               <h3 class="text-primary-950 font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3> | ||||||
|               <form action="/cox/trip/{{ trip.id }}" method="post" class="grid gap-3"> |               <form action="/cox/trip/{{ trip.id }}" method="post" class="grid gap-3"> | ||||||
|                 {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=trip.max_people) }} |                 {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=trip.max_people, min='0') }} | ||||||
|                 {{ macros::input(label='Anmerkungen', name='notes', type='input', value=trip.notes) }} |                 {{ macros::input(label='Anmerkungen', name='notes', type='input', value=trip.notes) }} | ||||||
|                 <input value="Bearbeiten" class="btn btn-primary" type="submit" /> |                 <input value="Bearbeiten" class="btn btn-primary" type="submit" /> | ||||||
|               </form> |               </form> | ||||||
| @@ -277,8 +277,8 @@ | |||||||
| <div class="hidden"> | <div class="hidden"> | ||||||
|   <form action="/cox/trip" method="post" class="grid gap-3" id="sidebarForm"> |   <form action="/cox/trip" method="post" class="grid gap-3" id="sidebarForm"> | ||||||
|     <input class="day-js" type="hidden" name="day" value="" /> |     <input class="day-js" type="hidden" name="day" value="" /> | ||||||
|     {{ macros::input(label='Startzeit (zB "10:00")', name='planned_starting_time', type='input', required=true) }} |     {{ macros::input(label='Startzeit (zB "10:00")', name='planned_starting_time', type='time', required=true) }} | ||||||
|     {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true) }} |     {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, min='0') }} | ||||||
|     {{ macros::input(label='Anmerkungen', name='notes', type='input') }} |     {{ macros::input(label='Anmerkungen', name='notes', type='input') }} | ||||||
|     <input value="Erstellen" class="w-full btn btn-primary" type="submit" /> |     <input value="Erstellen" class="w-full btn btn-primary" type="submit" /> | ||||||
|   </form> |   </form> | ||||||
| @@ -290,9 +290,9 @@ | |||||||
|   <form action="/admin/planned-event" method="post" class="grid gap-3" id="addEventForm"> |   <form action="/admin/planned-event" method="post" class="grid gap-3" id="addEventForm"> | ||||||
|     <input class="day-js" type="hidden" name="day" value="" /> |     <input class="day-js" type="hidden" name="day" value="" /> | ||||||
|     {{ macros::input(label='Titel (z.B. Firmenrudern)', name='name', type='input', required=true) }} |     {{ macros::input(label='Titel (z.B. Firmenrudern)', name='name', type='input', required=true) }} | ||||||
|     {{ macros::input(label='Startzeit', name='planned_starting_time', type='input', required=true) }} |     {{ macros::input(label='Startzeit', name='planned_starting_time', type='time', required=true) }} | ||||||
|     {{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', required=true) }} |     {{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', required=true, min='0') }} | ||||||
|     {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true) }} |     {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, min='0') }} | ||||||
|     {{ macros::checkbox(label='Gäste erlauben', name='max_allow_guestspeople') }} |     {{ macros::checkbox(label='Gäste erlauben', name='max_allow_guestspeople') }} | ||||||
|     {{ macros::input(label='Anmerkungen', name='notes', type='input') }} |     {{ macros::input(label='Anmerkungen', name='notes', type='input') }} | ||||||
|     <input value="Erstellen" class="w-full btn btn-primary" type="submit" /> |     <input value="Erstellen" class="w-full btn btn-primary" type="submit" /> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user