brass/templates/availability/new_or_edit.html

99 lines
3.9 KiB
HTML

{% extends "nav.html" %}
{% block content %}
<section class="section">
<div class="container">
{% if id.is_some() %}
<form method="post" action="/availabillity/edit/{{ id.unwrap() }}">
<h1 class="title">Bearbeite Vefügbarkeit für den {{ date.format("%d.%m.%Y") }}</h1>
{% else %}
<form method="post" action="/availabillity/new">
<h1 class="title">Neue Vefügbarkeit für den {{ date.format("%d.%m.%Y") }}</h1>
{% endif %}
<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 id.is_some() %}
<input type="radio" name="hasTime" hx-get="/availabillity/edit/{{ id.unwrap() }}?wholeday=true"
hx-target="closest body" {{ whole_day|cond_show("checked") }} />
{% else %}
<input type="radio" name="hasTime" hx-get="/availabillity/new?date={{ date }}&wholeday=true"
hx-target="closest body" {{ whole_day|cond_show("checked") }} />
{% endif %}
ganztägig
<label class="radio">
{% if id.is_some() %}
<input type="radio" name="hasTime" hx-get="/availabillity/edit/{{ id.unwrap() }}?wholeday=false"
hx-target="closest body" {{ whole_day|invert|cond_show("checked") }} />
{% else %}
<input type="radio" name="hasTime" hx-get="/availabillity/new?date={{ date }}&wholeday=false"
hx-target="closest body" {{ whole_day|invert|cond_show("checked") }} />
{% 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.unwrap_or("00:00") }}' {{
whole_day|cond_show("disabled") }} {{ whole_day|invert|cond_show("required") }}>
</div>
<div class="field">
<input class="input" type="time" id="till" name="till" value='{{ end_time.unwrap_or("23:59") }}' {{
whole_day|cond_show("disabled") }} {{ whole_day|invert|cond_show("required") }}>
</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.unwrap_or("") }}</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">
{% if id.is_some() %}
<input class="button is-link" type="submit" value="Bearbeiten">
{% else %}
<input class="button is-link" type="submit" value="Erstellen">
{% endif %}
</div>
<div class="control">
<a class="button is-link is-light" href="/?date={{ date }}" hx-boost="true">Zurück</a>
</div>
</div>
</div>
</div>
</form>
</div>
</section>
{% endblock %}