118 lines
2.8 KiB
HTML
118 lines
2.8 KiB
HTML
{% extends "nav.html" %}
|
|
|
|
{% block content %}
|
|
<section class="section">
|
|
<div class="container">
|
|
<form method="post" action="/availabillity/edit/{{ id }}">
|
|
<h1 class="title">Bearbeite Vefügbarkeit für den {{ date.format("%d.%m.%Y") }}</h1>
|
|
|
|
<input type="hidden" name="date" value="{{ date }}">
|
|
|
|
<div class="field is-horizontal">
|
|
<div class="field-label">
|
|
<label class="label">Dauer</label>
|
|
</div>
|
|
<div class="field-body">
|
|
<div class="field">
|
|
<div class="control">
|
|
<label class="radio">
|
|
{% if has_time %}
|
|
<input type="radio" id="wholeDay" name="hasTime">
|
|
{% else %}
|
|
<input type="radio" id="wholeDay" name="hasTime" checked>
|
|
{% endif %}
|
|
ganztägig
|
|
<label class="radio">
|
|
{% if has_time %}
|
|
<input type="radio" id="partDay" name="hasTime" checked>
|
|
{% else %}
|
|
<input type="radio" id="partDay" name="hasTime">
|
|
{% endif %}
|
|
zeitweise
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field is-horizontal">
|
|
<div class="field-label">
|
|
<label class="label">Von - Bis</label>
|
|
</div>
|
|
<div class="field-body">
|
|
<div class="field">
|
|
<input class="input" type="time" id="from" name="from" value="{{ start_time }}" disabled>
|
|
</div>
|
|
<div class="field">
|
|
<input class="input" type="time" id="till" name="till" value="{{ end_time }}" disabled>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field is-horizontal">
|
|
<div class="field-label">
|
|
<label class="label">Kommentar</label>
|
|
</div>
|
|
<div class="field-body">
|
|
<div class="field">
|
|
<div class="control">
|
|
<textarea class="textarea" name="comment" placeholder="nur Posten, nur Wachhabender, etc..">{{ comment }}</textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field is-horizontal">
|
|
<div class="field-label"></div>
|
|
<div class="field-body">
|
|
<div class="field is-grouped">
|
|
<div class="control">
|
|
<input class="button is-link" type="submit" value="Speichern">
|
|
</div>
|
|
<div class="control">
|
|
<a class="button is-link is-light" href="/?date={{ date }}">Zurück</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
</section>
|
|
|
|
<script>
|
|
const wholeDay = document.getElementById("wholeDay");
|
|
const partDay = document.getElementById("partDay");
|
|
|
|
const from = document.getElementById("from");
|
|
const till = document.getElementById("till");
|
|
|
|
let lastFrom = null;
|
|
let lastTill = null;
|
|
|
|
wholeDay.addEventListener("click", (event) => {
|
|
from.disabled = true
|
|
till.disabled = true
|
|
|
|
lastFrom = from.value;
|
|
lastTill = till.value;
|
|
|
|
from.value = null;
|
|
till.value = null;
|
|
});
|
|
|
|
partDay.addEventListener("click", (event) => {
|
|
from.disabled = false
|
|
till.disabled = false
|
|
|
|
if (lastFrom != null) {
|
|
from.value = lastFrom;
|
|
}
|
|
|
|
if (lastTill != null) {
|
|
till.value = lastTill;
|
|
}
|
|
});
|
|
</script>
|
|
{% endblock %}
|