diff --git a/templates/admin/boat/boat.html.tera b/templates/admin/boat/boat.html.tera new file mode 100644 index 0000000..01e6263 --- /dev/null +++ b/templates/admin/boat/boat.html.tera @@ -0,0 +1,65 @@ +{% macro new() %} +
+
+

+ Neues Boot hinzufügen +

+ {{ 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(data=locations, label='location', select_name='location_id', selected_id=1) }} + {{ macros::select(data=users, label='users', select_name='owner', default="Vereinsboot") }} + {{ 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")}} +
+
+ +
+
+{% endmacro checkbox %} + + +{% macro edit(boat, uuid) %} +
+
+ +
{{ boat.name }}
+
+ {{ 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) }} + {{ macros::select(data=locations, label='location', select_name='location_id', selected_id=boat.location_id) }} + {{ macros::select(data=users, label='users', select_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='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) }} +
+
+
+ + {% include "includes/delete-icon" %} Löschen + + +
+
+{% endmacro checkbox %} diff --git a/templates/admin/boat/index.html.tera b/templates/admin/boat/index.html.tera index e799005..94f1458 100644 --- a/templates/admin/boat/index.html.tera +++ b/templates/admin/boat/index.html.tera @@ -1,93 +1,19 @@ {% import "includes/macros" as macros %} +{% import "admin/boat/boat" as boat %} {% extends "base" %} {% block content %} +
- {% if flash %} - {{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} - {% endif %} -

Boats

+ {{ boat::new() }} -
-
-

Neues Boot hinzufügen

-
-
- - -
-
- - -
-
- - -
-
- - -
- {{ macros::select(data=locations, label='location', select_name='location_id', selected_id=1) }} - {{ macros::select(data=users, label='users', select_name='owner', default="Vereinsboot") }} -
- default_shipmaster_only_steering: - - -
-
- skull: - - -
-
- external: - - -
-
+
+ {% for boat in boats %} + {{ boat::edit(boat=boat, uuid=loop.index) }} + {% endfor %}
-
- -
- - - -
-
- {% for boat in boats %} -
-
- -
{{ boat.name }}
-
-
- - - {{ 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) }} - {{ macros::select(data=locations, label='location', select_name='location_id', selected_id=boat.location_id) }} - {{ macros::select(data=users, label='users', select_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='default_shipmaster_only_steering', name='default_shipmaster_only_steering', id=loop.index , checked=boat.default_shipmaster_only_steering) }} - {{ macros::checkbox(label='skull', name='skull', id=loop.index , checked=boat.skull) }} - {{ macros::checkbox(label='external', name='external', id=loop.index , checked=boat.external) }} -
-
- -
-{% endfor %} -
-
{% endblock content %}