show waterlevel for the next days #466

Merged
philipp merged 39 commits from show-waterlevel into main 2024-05-16 21:32:24 +02:00
6 changed files with 13 additions and 10 deletions
Showing only changes of commit 7a8b79ccef - Show all commits

View File

@ -27,7 +27,7 @@ pub struct Boat {
#[serde(default = "bool::default")]
skull: bool,
#[serde(default = "bool::default")]
external: bool,
pub external: bool,
pub deleted: bool,
}

View File

@ -582,13 +582,13 @@ ORDER BY departure DESC
).await;
}
if boat.name == "Externes Boot" {
if boat.external {
let vorstand = Role::find_by_name_tx(db, "Vorstand").await.unwrap();
Notification::create_for_role_tx(
db,
&vorstand,
&format!("'{}' hat eine Ausfahrt mit *Externem Boot* am {} eingetragen ({} km; Ziel: {}; Anmerkungen: {}). Falls das nicht stimmen sollte, bitte nachhaken.",user.name,log.departure,log.distance_in_km, log.destination, log.comments.unwrap_or("".into())),
&format!("'{}' hat eine Ausfahrt mit externem Boot '{}' am {} eingetragen ({} km; Ziel: {}; Anmerkungen: {}). Falls das nicht stimmen sollte, bitte nachhaken.",user.name,boat.name,log.departure,log.distance_in_km, log.destination, log.comments.unwrap_or("".into())),
"Ausfahrt mit externem Boot eingetragen",
None,
).await;

View File

@ -40,7 +40,7 @@ LEFT JOIN
LEFT JOIN
location ON boat.location_id = location.id
WHERE
boat.name != 'Externes Boot' AND not boat.external
not boat.external
GROUP BY
boat.id, year
ORDER BY
@ -115,7 +115,7 @@ LEFT JOIN (
FROM rower
GROUP BY logbook_id
) m ON l.id = m.logbook_id
WHERE l.distance_in_km IS NOT NULL AND l.arrival LIKE '{year}-%' AND b.name != 'Externes Boot';
WHERE l.distance_in_km IS NOT NULL AND l.arrival LIKE '{year}-%' AND not b.external;
"
))
.fetch_one(db)

View File

@ -27,7 +27,7 @@ async fn index(
let boats = Boat::all_for_boatshouse(db).await;
let mut final_boats = Vec::new();
for boat in boats {
if boat.boat.boathouse(db).await.is_none() && boat.boat.name != "Externes Boot" {
if boat.boat.boathouse(db).await.is_none() && !boat.boat.external {
final_boats.push(boat);
}
}

View File

@ -7,8 +7,11 @@
{% set aisle = aisle_name ~ "-aisle" %}
{% set place = boathouse[aisle][side_name] %}
{% if place[level] %}
{{ place[level].1.name }} <a class="btn btn-primary absolute end-0"
{{ place[level].1.name }}
{% if "admin" in loggedin_user.roles %}
<a class="btn btn-primary absolute end-0"
href="/board/boathouse/{{ place[level].0 }}/delete">X</a>
{% endif %}
{% elif boats | length > 0 %}
{% if "admin" in loggedin_user.roles %}
<details>

View File

@ -228,9 +228,9 @@
{{ rower.name }}
{%- if rower.id == log.steering_user.id and rower.id != log.shipmaster_user.id %}
(Steuerperson){%- endif -%}
{%- if not loop.last or amount_guests > 0 and log.boat.name != 'Externes Boot' %},{% endif %}
{%- if not loop.last or amount_guests > 0 and not log.boat.external %},{% endif %}
{% endfor -%}
{% if amount_guests > 0 and log.boat.name != 'Externes Boot' %}
{% if amount_guests > 0 and not log.boat.external %}
Gäste
<small class="text-gray-600 dark:text-gray-100">(ohne Account)</small>:
{{ amount_guests }}