forked from Ruderverein-Donau-Linz/rowt
[WIP] styling kiosk page
This commit is contained in:
@ -19,18 +19,19 @@
|
||||
<input type="hidden" name="shipmaster" value="{{shipmaster}}" />
|
||||
{% endif %}
|
||||
{% if not only_ones %}
|
||||
{{ macros::checkbox(label='shipmaster_only_steering', name='shipmaster_only_steering') }}
|
||||
{{ macros::checkbox(label='handgesteuert', name='shipmaster_only_steering') }}
|
||||
{% endif %}
|
||||
|
||||
{% if not only_ones %}
|
||||
{{ log::rower_select(id="newrower", selected=[], class="col-span-2") }}
|
||||
{% endif %}
|
||||
|
||||
{{ macros::input(label='Abfahrtszeit', name='departure', type='datetime-local', required=true) }}
|
||||
{{ macros::input(label='Ankunftszeit', name='arrival', type='datetime-local') }}
|
||||
|
||||
<div>Departure: <input type="datetime-local" id="datetime-dep" name="departure" required/></div>
|
||||
<div> Arrival: <input type="datetime-local" id="datetime-arr" name="arrival" /></div>
|
||||
<div class="col-span-2">
|
||||
Destination: <input type="search" list="destinations" placeholder="Destination" name="destination" id="destination" oninput="var inputElement = document.getElementById('destination');
|
||||
<div>
|
||||
<label for="destination" class="small text-gray-600">Ziel</label>
|
||||
<input type="search" class="input rounded-md" list="destinations" placeholder="Destination" name="destination" id="destination" oninput="var inputElement = document.getElementById('destination');
|
||||
var dataList = document.getElementById('destinations');
|
||||
var selectedValue = inputElement.value;
|
||||
for (var i = 0; i < dataList.options.length; i++) {
|
||||
@ -46,10 +47,18 @@
|
||||
{% endfor %}
|
||||
</datalist>
|
||||
</div>
|
||||
{{ macros::input(label="Distanz", name="distance_in_km", type="number", min=0, wrapper_class="col-span-2") }}
|
||||
|
||||
<div class="relative">
|
||||
{{ macros::input(label="Distanz", name="distance_in_km", type="number", min=1) }}
|
||||
<span class="absolute right-0 bottom-0 py-1.5 px-2 bg-white border-0 text-gray-600 ring-1 ring-inset ring-gray-300 rounded-br-md rounded-tr-md">km</span>
|
||||
</div>
|
||||
{{ macros::input(label="Kommentar", name="comments", type="text", wrapper_class="col-span-2") }}
|
||||
{{ macros::select(data=logtypes, select_name='logtype', default="Normal", class="col-span-2") }}
|
||||
<input type="submit" value="Starten" class="btn btn-primary w-100 col-span-2 m-auto" />
|
||||
|
||||
<div class="col-span-2">
|
||||
<label for="logtype" class=" small text-gray-600 ">Typ</label>
|
||||
{{ macros::select(data=logtypes, select_name='logtype', default="Normal") }}
|
||||
</div>
|
||||
<input type="submit" value="Ausfahrt starten" class="btn btn-primary w-full col-span-2 m-auto" />
|
||||
|
||||
<script>
|
||||
const currentDate = new Date();
|
||||
@ -57,13 +66,13 @@
|
||||
const formattedDate = localTime.toISOString().slice(0, 16);
|
||||
|
||||
// Set the formatted string as the value of the input field
|
||||
document.getElementById("datetime-dep").value = formattedDate;
|
||||
document.getElementById("departure").value = formattedDate;
|
||||
</script>
|
||||
</form>
|
||||
<script>
|
||||
document.getElementById('form').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
for(let optional_elem of ["datetime-arr", "distance_in_km", "comments", "logtype"]){
|
||||
for(let optional_elem of ["arrival", "distance_in_km", "comments", "logtype"]){
|
||||
let myInput = document.getElementById(optional_elem);
|
||||
if (myInput.value === '') {
|
||||
myInput.removeAttribute('name');
|
||||
|
Reference in New Issue
Block a user