Compare commits

..

No commits in common. "8b42bdce0c6b00fdeea52cb5192c649f62315fa9" and "fc7ca28f5675c6cbbd1d0be421190ba9e28a93c9" have entirely different histories.

2 changed files with 15 additions and 13 deletions

View File

@ -180,14 +180,10 @@ AND date('now') BETWEEN start_date AND end_date;",
if boat.is_locked(db).await {
damage = BoatDamage::Locked;
}
let cat = if boat.external {
format!("Vereinsfremde Boote")
let cat = if boat.default_shipmaster_only_steering {
format!("{}+", boat.amount_seats - 1)
} else {
if boat.default_shipmaster_only_steering {
format!("{}+", boat.amount_seats - 1)
} else {
format!("{}x", boat.amount_seats)
}
format!("{}x", boat.amount_seats)
};
res.push(BoatWithDetails {
@ -263,7 +259,7 @@ ORDER BY
"
SELECT id, name, amount_seats, location_id, owner, year_built, boatbuilder, default_shipmaster_only_steering, default_destination, skull, external, deleted, convert_handoperated_possible
FROM boat
WHERE (owner is null or owner = ?) AND deleted = 0
WHERE owner is null or owner = ?
ORDER BY amount_seats DESC
",
user.id
@ -277,7 +273,7 @@ ORDER BY amount_seats DESC
"
SELECT id, name, amount_seats, location_id, owner, year_built, boatbuilder, default_shipmaster_only_steering, default_destination, skull, external, deleted, convert_handoperated_possible
FROM boat
WHERE (owner = ? OR (owner is null and amount_seats = 1)) AND deleted = 0
WHERE owner = ? OR (owner is null and amount_seats = 1)
ORDER BY amount_seats DESC
",
user.id
@ -295,7 +291,7 @@ ORDER BY amount_seats DESC
Boat,
"SELECT id, name, amount_seats, location_id, owner, year_built, boatbuilder, default_shipmaster_only_steering, default_destination, skull, external, deleted, convert_handoperated_possible
FROM boat
WHERE (owner is null and location_id = ?) AND deleted = 0
WHERE owner is null and location_id = ?
ORDER BY amount_seats DESC
",ottensheim.id)
.fetch_all(db)
@ -315,7 +311,7 @@ ORDER BY amount_seats DESC
SELECT boat.id, boat.name, amount_seats, location_id, owner, year_built, boatbuilder, default_shipmaster_only_steering, default_destination, skull, external, deleted, convert_handoperated_possible
FROM boat
INNER JOIN location ON boat.location_id = location.id
WHERE location.name=? AND deleted = 0
WHERE location.name=?
ORDER BY amount_seats DESC
",
location

View File

@ -3,10 +3,16 @@
Inputs: boats
#}
{% macro show_boats() %}
{% for cat, grouped_boats in boats | group_by(attribute="cat") %}
{% for amount_seats, grouped_boats in boats | group_by(attribute="cat") %}
<details>
<summary class="font-bold cursor-pointer text-primary-900 dark:text-white border-t p-3 hover:bg-gray-100 dark:hover:bg-primary-950">
<span>{{ cat }}</span>
<span>
{% if grouped_boats[0].external %}
Vereinsfremde Boote
{% else %}
{{ grouped_boats[0].cat }}
{% endif %}
</span>
<small class="text-gray-500 dark:text-gray-100">({{ grouped_boats | length }})</small>
</summary>
<div class="pb-3">