2023-07-26 12:24:22 +02:00
|
|
|
{% macro new() %}
|
2023-07-30 14:33:50 +02:00
|
|
|
<form action="/admin/boat/new" method="post" class="mt-4 bg-primary-900 rounded-md text-white px-3 pb-3 pt-2 sm:flex items-end justify-between">
|
|
|
|
<div class="w-full">
|
|
|
|
<h2 class="text-md font-bold mb-2 uppercase tracking-wide">
|
|
|
|
Neues Boot hinzufügen
|
|
|
|
</h2>
|
|
|
|
{{ 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") }}
|
2023-09-05 22:48:02 +02:00
|
|
|
{{ macros::select(data=locations, label='location', name='location_id', selected_id=1) }}
|
|
|
|
{{ macros::select(data=users, label='users', name='owner', default="Vereinsboot") }}
|
2023-07-30 14:33:50 +02:00
|
|
|
{{ macros::checkbox(label="Steuerperson steuert nur", name="default_shipmaster_only_steering")}}
|
|
|
|
{{ macros::checkbox(label="Skull", name="skull", checked=true)}}
|
|
|
|
{{ macros::checkbox(label="Externes Boot (anderer Verein)", name="external")}}
|
|
|
|
</div>
|
|
|
|
<div class="text-right">
|
|
|
|
<input value="Hinzufügen" type="submit" class="w-28 mt-2 sm:mt-0 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"/>
|
|
|
|
</div>
|
|
|
|
</form>
|
2023-07-26 12:56:19 +02:00
|
|
|
{% endmacro new %}
|
2023-07-26 12:24:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
{% macro edit(boat, uuid) %}
|
2023-07-31 16:25:07 +02:00
|
|
|
<form action="/admin/boat/{{ boat.id }}" data-filterable="true" method="post" class="bg-white p-3 rounded-md flex items-end md:items-center justify-between">
|
2023-07-30 14:33:50 +02:00
|
|
|
<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">
|
|
|
|
{{ macros::input(label='Name', name='name', type='text', value=boat.name) }}
|
|
|
|
{{ macros::input(label='Amount Seats', name='amount_seats', type='number', min=0, value=boat.amount_seats) }}
|
2023-09-05 22:48:02 +02:00
|
|
|
{{ macros::select(data=locations, label='location', name='location_id', selected_id=boat.location_id) }}
|
|
|
|
{{ macros::select(data=users, label='users', name='owner', selected_id=boat.owner, default="Vereinsboot") }}
|
2023-07-30 14:33:50 +02:00
|
|
|
{{ 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='default_shipmaster_only_steering', 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='external', name='external', id=uuid , checked=boat.external) }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="grid gap-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>
|
2023-07-26 12:56:19 +02:00
|
|
|
{% endmacro edit %}
|