rowt/templates/includes/forms/boat.html.tera

68 lines
4.3 KiB
Plaintext
Raw Normal View History

2023-07-26 12:24:22 +02:00
{% macro new() %}
2023-09-28 16:40:05 +02:00
<div class="w-full">
<h2 class="text-md font-bold tracking-wide bg-primary-900 mt-3 p-3 text-white flex justify-between items-center rounded-md">
Neues Boot
<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="Neues Boot anlegen" data-body="#new-boat">
{% include "includes/plus-icon" %}
<span class="sr-only">Neues Boot anlegen</span>
</a>
</h2>
<div class="hidden">
<div id="new-boat">
2023-09-28 17:34:08 +02:00
<form action="/admin/boat/new" method="post" class="grid gap-3">
2023-09-28 16:40:05 +02:00
{{ macros::input(label="Name", name="name", type="text", required=true) }}
{{ macros::input(label="Anzahl Sitze", name="amount_seats", type="number", required=true, min=1) }}
{{ macros::input(label="Baujahr", name="year_built", type="number", min=1950, max=2050) }}
{{ macros::input(label="Bootsbauer", name="boatbuilder", type="text") }}
{{ macros::select(label="Standort", data=locations, name='location_id', selected_id=1) }}
{{ macros::select(label="Besitzer", data=users, name='owner', default="Verein") }}
2023-09-28 17:34:08 +02:00
<div>
2023-09-28 16:40:05 +02:00
{{ macros::checkbox(label="handgesteuert", name="default_shipmaster_only_steering")}}
{{ macros::checkbox(label="Skull", name="skull", checked=true)}}
{{ macros::checkbox(label="Externes Boot (anderer Verein)", name="external")}}
</div>
<input value="Hinzufügen" type="submit" class="w-full mt-2 rounded-md bg-primary-500 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"/>
</form>
</div>
</div>
</div>
<div class="bg-gray-200 p-3 mt-4 rounded-t-md">
<label for="name" class="sr-only">Suche</label>
<input type="search" name="name" id="filter-js" class="w-full relative block rounded-md border-0 py-1.5 px-2 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6 mb-2 md:mb-0" placeholder="Suchen nach Namen...">
</div>
<div id="filter-result-js" class="bg-gray-200 text-primary-950 pb-3 px-3 text-right"></div>
2023-07-26 12:56:19 +02:00
{% endmacro new %}
2023-07-26 12:24:22 +02:00
{% macro edit(boat, uuid) %}
2023-09-28 16:40:05 +02:00
<div data-filterable="true" data-filter="{{ boat.name }}" class="w-full border-t">
<form action="/admin/boat/{{ boat.id }}" data-filterable="true" method="post" class="bg-white p-4 w-full">
<div class="w-full">
<input type="hidden" name="id" value="{{ boat.id }}"/>
<div class="font-bold mb-1">{{ boat.name }}<br/></div>
<div class="grid md:grid-cols-3 gap-3">
{{ macros::input(label='Name', name='name', type='text', value=boat.name) }}
{{ macros::input(label='Plätze', name='amount_seats', type='number', min=0, value=boat.amount_seats) }}
{{ macros::select(data=locations, label='Standort', name='location_id', selected_id=boat.location_id) }}
{{ macros::select(data=users, label='Besitzer', name='owner', selected_id=boat.owner, default="Vereinsboot") }}
{{ macros::input(label='Baujahr', name='year_built', type='number', min=1950, value=boat.year_built) }}
{{ macros::input(label='Bootsbauer', name='boatbuilder', type='text', value=boat.boatbuilder) }}
{{ macros::checkbox(label='hangesteuert', name='default_shipmaster_only_steering', id=uuid , checked=boat.default_shipmaster_only_steering) }}
{{ macros::checkbox(label='Skull', name='skull', id=uuid , checked=boat.skull) }}
{{ macros::checkbox(label='Externes Boot', name='external', id=uuid , checked=boat.external) }}
</div>
</div>
<div class="text-right mt-3">
<a href="/admin/boat/{{ boat.id }}/delete" class="inline-block btn btn-alert" onclick="return confirm('Wirklich löschen?');">
{% include "includes/delete-icon" %}
Löschen
</a>
<input value="Ändern" type="submit" class="w-28 btn btn-primary"/>
</div>
</form>
</div>
2023-07-26 12:56:19 +02:00
{% endmacro edit %}