reservations
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
<a href="/stat" class="px-2">Statistik</a>
|
||||
<a href="/stat/boats" class="px-2">Bootsauswertung</a>
|
||||
<a href="/boatdamage" class="px-2">Bootsschaden</a>
|
||||
<a href="/boatreservation" class="px-2">Bootsreservierung</a>
|
||||
</div>
|
||||
</header>
|
||||
{% endif %}
|
||||
|
67
templates/boatreservations.html.tera
Normal file
67
templates/boatreservations.html.tera
Normal file
@ -0,0 +1,67 @@
|
||||
{% import "includes/macros" as macros %}
|
||||
{% import "includes/forms/log" as log %}
|
||||
{% extends "base" %}
|
||||
{% block content %}
|
||||
<div class="max-w-screen-lg w-full">
|
||||
<h1 class="h1">Bootsreservierungen</h1>
|
||||
<h2 class="text-md font-bold tracking-wide bg-primary-900 mt-3 p-3 text-white flex justify-between items-center rounded-md">
|
||||
Neue Reservierung
|
||||
<a href="#"
|
||||
class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"
|
||||
data-sidebar="true"
|
||||
data-trigger="sidebar"
|
||||
data-header="Neue Reservierung anlegen"
|
||||
data-body="#new-reservation">
|
||||
{% include "includes/plus-icon" %}
|
||||
<span class="sr-only">Neue Reservierung eintragen</span>
|
||||
</a>
|
||||
</h2>
|
||||
<div class="hidden">
|
||||
<div id="new-reservation">
|
||||
<form action="/boatreservation" method="post" class="grid gap-3">
|
||||
{{ log::boat_select(only_ones=false, id='boat') }}
|
||||
{% if not loggedin_user %}{{ macros::select(label='Reserviert von', data=user, name='user_id_applicant') }}{% endif %}
|
||||
{{ macros::input(label='Beginn', name='start_date', type='date', required=true, wrapper_class='col-span-4') }}
|
||||
{{ macros::input(label='Ende', name='end_date', type='date', required=true, wrapper_class='col-span-4') }}
|
||||
{{ macros::input(label='Uhrzeit (zB ab 14:00 Uhr, ganztägig, ...)', name='time_desc', type='text', required=true, wrapper_class='col-span-4') }}
|
||||
{{ macros::input(label='Zweck (Wanderfahrt, ...)', name='usage', type='text', required=true, wrapper_class='col-span-4') }}
|
||||
<input type="submit"
|
||||
class="btn btn-primary w-full col-span-4"
|
||||
value="Reservierung eintragen" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-wrapper">
|
||||
<label for="name" class="sr-only">Suche</label>
|
||||
<input type="search"
|
||||
name="name"
|
||||
id="filter-js"
|
||||
class="search-bar"
|
||||
placeholder="Suchen nach Namen...">
|
||||
</div>
|
||||
<div id="filter-result-js" class="search-result"></div>
|
||||
{% for reservation in boatreservations %}
|
||||
<div data-filterable="true"
|
||||
data-filter="TODO: ADD FILTER"
|
||||
class="w-full border-t bg-white dark:bg-primary-900 text-black dark:text-white p-3">
|
||||
<div class="w-full">
|
||||
Boot: {{ reservation.boat.name }}
|
||||
<br />
|
||||
Datum: {{ reservation.start_date }}
|
||||
{% if reservation.end_date != reservation.start_date %}- {{ reservation.end_date }}{% endif %}
|
||||
<br />
|
||||
Uhrzeit: {{ reservation.time_desc }}
|
||||
<br />
|
||||
Zweck: {{ reservation.usage }}
|
||||
<br />
|
||||
Reserviert von {{ reservation.user_applicant.name }}
|
||||
{% if loggedin_user %}
|
||||
{% if loggedin_user.id == reservation.user_applicant.id or "admin" in loggedin_user.roles %}
|
||||
<a href="/boatreservation/{{ reservation.id }}/delete">RESERVIERUNG LÖSCHEN</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock content %}
|
@ -2,12 +2,15 @@
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow grid gap-3"
|
||||
style="margin-top: 10px">
|
||||
<h2 class="h2">Bootsreservierungen</h2>
|
||||
<div class="p2" style="margin-bottom: 10px;">
|
||||
<ul style="display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 0;
|
||||
list-style: none">
|
||||
<li style="display: inline-block;">30.03. | Manuela Firmötz | Boot: Urfahr</li>
|
||||
<div class="p2 text-center" style="margin-bottom: 10px;">
|
||||
<ul style=" justify-content: space-around; padding: 0; list-style: none">
|
||||
{% for reservation in reservations %}
|
||||
<li>
|
||||
{{ reservation.boat.name }} • {{ reservation.start_date }}
|
||||
{% if reservation.end_date != reservation.start_date %}- {{ reservation.end_date }}{% endif %}
|
||||
• Uhrzeit: {{ reservation.time_desc }} • Zweck: {{ reservation.usage }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@ -141,7 +144,7 @@
|
||||
{% if required %}required="required"{% endif %}>
|
||||
{% if default %}<option selected value>{{ default }}</option>{% endif %}
|
||||
{% for d in data %}
|
||||
<option value="{{ d.id }}" {% if d.id == selected_id %}selected{% endif %} {% if extras != '' %} {% for extra in extras %} {% if extra != 'on_water' and d[extra] %} data-{{ extra }}={{ d[extra] }} {% else %} {% if d[extra] %}disabled{% endif %} {% endif %} {% endfor %} {% endif %} {% if show_seats %} data-custom-properties='{"amount_seats": {{ d["amount_seats"] }}, "owner": "{{ d["owner"] }}", "default_destination": "{{ d["default_destination"] }}", "boat_in_ottensheim": {{ d["location_id"] == 2 }}}'{% endif %}>
|
||||
<option value="{{ d.id }}" {% if d.id == selected_id %}selected{% endif %} {% if extras != '' %} {% for extra in extras %} {% if extra != 'on_water' and d[extra] %} data-{{ extra }}={{ d[extra] }} {% else %} {% if d[extra] %}disabled{% endif %} {% endif %} {% endfor %} {% endif %} {% if show_seats %} data-custom-properties='{"amount_seats": {{ d["amount_seats"] }}, "owner": "{{ d["owner"] }}", "default_destination": "{{ d["default_destination"] }}", "boat_in_ottensheim": {{ d["location_id"] == 2 }}, "boat_reserved_today": {{ d["reserved_today"] }}}'{% endif %}>
|
||||
{% for displa in display -%}
|
||||
{%- if d[displa] -%}
|
||||
{{- d[displa] -}}
|
||||
|
@ -90,6 +90,10 @@
|
||||
<li class="py-1">
|
||||
<a href="/boatdamage" class="block w-100 py-2 hover:text-primary-600">Bootsschaden</a>
|
||||
</li>
|
||||
<li class="py-1">
|
||||
<a href="/boatreservation"
|
||||
class="block w-100 py-2 hover:text-primary-600">Bootsreservierung</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user