no special treatment for 'externes boot'
This commit is contained in:
parent
8b42bdce0c
commit
87307378c6
@ -27,7 +27,7 @@ pub struct Boat {
|
|||||||
#[serde(default = "bool::default")]
|
#[serde(default = "bool::default")]
|
||||||
skull: bool,
|
skull: bool,
|
||||||
#[serde(default = "bool::default")]
|
#[serde(default = "bool::default")]
|
||||||
external: bool,
|
pub external: bool,
|
||||||
pub deleted: bool,
|
pub deleted: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -582,13 +582,13 @@ ORDER BY departure DESC
|
|||||||
).await;
|
).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
if boat.name == "Externes Boot" {
|
if boat.external {
|
||||||
let vorstand = Role::find_by_name_tx(db, "Vorstand").await.unwrap();
|
let vorstand = Role::find_by_name_tx(db, "Vorstand").await.unwrap();
|
||||||
|
|
||||||
Notification::create_for_role_tx(
|
Notification::create_for_role_tx(
|
||||||
db,
|
db,
|
||||||
&vorstand,
|
&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",
|
"Ausfahrt mit externem Boot eingetragen",
|
||||||
None,
|
None,
|
||||||
).await;
|
).await;
|
||||||
|
@ -40,7 +40,7 @@ LEFT JOIN
|
|||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
location ON boat.location_id = location.id
|
location ON boat.location_id = location.id
|
||||||
WHERE
|
WHERE
|
||||||
boat.name != 'Externes Boot' AND not boat.external
|
not boat.external
|
||||||
GROUP BY
|
GROUP BY
|
||||||
boat.id, year
|
boat.id, year
|
||||||
ORDER BY
|
ORDER BY
|
||||||
@ -115,7 +115,7 @@ LEFT JOIN (
|
|||||||
FROM rower
|
FROM rower
|
||||||
GROUP BY logbook_id
|
GROUP BY logbook_id
|
||||||
) m ON l.id = m.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)
|
.fetch_one(db)
|
||||||
|
@ -27,7 +27,7 @@ async fn index(
|
|||||||
let boats = Boat::all_for_boatshouse(db).await;
|
let boats = Boat::all_for_boatshouse(db).await;
|
||||||
let mut final_boats = Vec::new();
|
let mut final_boats = Vec::new();
|
||||||
for boat in boats {
|
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);
|
final_boats.push(boat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,9 +228,9 @@
|
|||||||
{{ rower.name }}
|
{{ rower.name }}
|
||||||
{%- if rower.id == log.steering_user.id and rower.id != log.shipmaster_user.id %}
|
{%- if rower.id == log.steering_user.id and rower.id != log.shipmaster_user.id %}
|
||||||
(Steuerperson){%- endif -%}
|
(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 -%}
|
{% endfor -%}
|
||||||
{% if amount_guests > 0 and log.boat.name != 'Externes Boot' %}
|
{% if amount_guests > 0 and not log.boat.external %}
|
||||||
Gäste
|
Gäste
|
||||||
<small class="text-gray-600 dark:text-gray-100">(ohne Account)</small>:
|
<small class="text-gray-600 dark:text-gray-100">(ohne Account)</small>:
|
||||||
{{ amount_guests }}
|
{{ amount_guests }}
|
||||||
|
Loading…
Reference in New Issue
Block a user