Compare commits

..

No commits in common. "fda2673f5a22461a693e43dbff98e1f518214262" and "7614cc8fae79b45178f11cab1b6ead9d6ece8a0c" have entirely different histories.

2 changed files with 14 additions and 30 deletions

View File

@ -146,7 +146,7 @@ CREATE TABLE IF NOT EXISTS "boathouse" (
"boat_id" INTEGER NOT NULL REFERENCES boat(id),
"aisle" TEXT NOT NULL CHECK (aisle in ('water', 'middle', 'mountain')),
"side" TEXT NOT NULL CHECK(side IN ('mountain', 'water')),
"level" INTEGER NOT NULL CHECK(level BETWEEN 0 AND 11),
"level" INTEGER NOT NULL CHECK(level BETWEEN 0 AND 3),
CONSTRAINT unq UNIQUE (aisle, side, level) -- only 1 boat allowed to rest at each space
);

View File

@ -10,22 +10,18 @@
{{ place[level].1.name }} <a class="btn btn-primary absolute end-0"
href="/board/boathouse/{{ place[level].0 }}/delete">X</a>
{% elif boats | length > 0 %}
{% if "admin" in loggedin_user.roles %}
<details>
<summary>Kein Boot</summary>
<form action="/board/boathouse" method="post" class="grid gap-3">
{{ macros::select(label="Boot", data=boats, name="boat_id", id="boat_id", display=["name", " (","amount_seats", " x)"], wrapper_class="col-span-4") }}
<input type="hidden" name="aisle" value="{{ aisle_name }}" />
<input type="hidden" name="side" value="{{ side_name }}" />
<input type="hidden" name="level" value="{{ level }}" />
<input type="submit"
class="btn btn-primary w-full col-span-4"
value="Boot eintragen" />
</form>
</details>
{% else %}
Kein Boot
{% endif %}
<details>
<summary>Kein Boot</summary>
<form action="/board/boathouse" method="post" class="grid gap-3">
{{ macros::select(label="Boot", data=boats, name="boat_id", id="boat_id", display=["name", " (","amount_seats", " x)"], wrapper_class="col-span-4") }}
<input type="hidden" name="aisle" value="{{ aisle_name }}" />
<input type="hidden" name="side" value="{{ side_name }}" />
<input type="hidden" name="level" value="{{ level }}" />
<input type="submit"
class="btn btn-primary w-full col-span-4"
value="Boot eintragen" />
</form>
</details>
{% else %}
Kein Boot
{% endif %}
@ -39,9 +35,7 @@
{{ self::show_place(aisle_name = aisle_name, side_name = side_name, level = 2) }}
{{ self::show_place(aisle_name = aisle_name, side_name = side_name, level = 3) }}
{{ self::show_place(aisle_name = aisle_name, side_name = side_name, level = 4) }}
{% if aisle_name != 'water' or side_name != 'water' %}
{{ self::show_place(aisle_name = aisle_name, side_name = side_name, level = 5) }}
{% endif %}
{{ self::show_place(aisle_name = aisle_name, side_name = side_name, level = 5) }}
{% set show_additional = false %}
{% if aisle_name == "mountain" %}
{% set show_additional = true %}
@ -63,16 +57,6 @@
{% macro show_aisle(name, last=false) %}
<div id="{{ name }}-aisle"
class="grid grid-cols-2 gap-4 {% if not last %}md:border-r{% endif %}">
<h1 class="col-span-2 text-center">
{% if name == "water" %}
🌊
{% elif name == "middle" %}
{% else %}
⛰️
{% endif %}
- Gang
</h1>
{{ self::show_side(aisle_name = name, side_name = "mountain") }}
{{ self::show_side(aisle_name = name, side_name = "water") }}
</div>