brass/web/templates/availability/new_or_edit.html

90 lines
3.2 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 }}">
{% let time = "%R" %}
<div class="field is-horizontal">
<div class="field-label">
<label class="label">Dauer Von - Bis</label>
</div>
<div class="field-body">
<div class="field">
<input class="input" type="time" id="from" name="from" required {% if let Some(start)=start
%}value="{{start}}" {% endif %}>
{% if slot_suggestions.len() > 0 %}
<p class="help">noch mögliche Zeiträume:</p>
<div class="tags help">
{% for (s, e) in slot_suggestions %}
<span class="tag">{{ s.format(time) }} - {{ e.format(time) }}</span>
{% endfor %}
</div>
{% endif %}
</div>
<div class="field">
<input class="input" type="datetime-local" id="till" name="till" required min="{{ date }}T00:00"
max="{{ date.checked_add_days(Days::new(1)).unwrap() }}T23:59" {% if let Some(end)=end %}value="{{end}}"
{% endif %}>
</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">
<button class="button is-success">
<svg class="icon">
<use href="/static/feather-sprite.svg#check-circle" />
</svg>
<span>
{% if id.is_some() %}
Speichern
{% else %}
Erstellen
{% endif %}
</span>
</button>
</div>
<div class="control">
<a class="button is-link is-light" hx-boost="true" href="/?date={{ date }}">
<svg class="icon">
<use href="/static/feather-sprite.svg#arrow-left" />
</svg>
<span>Zurück</span>
</a>
</div>
</div>
</div>
</div>
</form>
</div>
</section>
{% endblock %}