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

68 lines
4.1 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>
2023-11-04 19:33:36 +01:00
<div class="search-wrapper">
2023-09-28 16:40:05 +02:00
<label for="name" class="sr-only">Suche</label>
2023-11-04 19:33:36 +01:00
<input type="search" name="name" id="filter-js" class="search-bar" placeholder="Suchen nach Namen...">
2023-09-28 16:40:05 +02:00
</div>
2023-11-04 19:33:36 +01:00
<div id="filter-result-js" class="search-result"></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">
2023-11-04 19:33:36 +01:00
<form action="/admin/boat/{{ boat.id }}" data-filterable="true" method="post" class="bg-white dark:bg-primary-900 p-4 w-full">
2023-09-28 16:40:05 +02:00
<div class="w-full">
<input type="hidden" name="id" value="{{ boat.id }}"/>
2023-11-04 19:33:36 +01:00
<div class="font-bold mb-1 text-black dark:text-white">{{ boat.name }}<br/></div>
2023-09-28 16:40:05 +02:00
<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 %}