Compare commits
No commits in common. "7193760f0507b2ac40e64b44f4013d3e569bb0ab" and "99fb9c624de3ffaa7bc0bb8367ba2043e9230220" have entirely different histories.
7193760f05
...
99fb9c624d
@ -67,7 +67,7 @@ FROM user_trip WHERE trip_details_id = ?
|
||||
name: r.name.or(r.user_note).unwrap(), //Ok, either name or user_note needs to be set
|
||||
registered_at: r.registered_at,
|
||||
is_guest: r.is_guest,
|
||||
is_real_guest: r.user_id.is_none(),
|
||||
is_real_guest: r.user_id == None,
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
@ -20,10 +20,10 @@ impl Stat {
|
||||
"
|
||||
SELECT (SELECT name FROM boat WHERE id=logbook.boat_id) as name, CAST(SUM(distance_in_km) AS INTEGER) AS rowed_km
|
||||
FROM logbook
|
||||
WHERE arrival LIKE '{year}-%'
|
||||
WHERE arrival LIKE '{}-%'
|
||||
GROUP BY boat_id
|
||||
ORDER BY rowed_km DESC;
|
||||
")
|
||||
",year)
|
||||
)
|
||||
.fetch_all(db)
|
||||
.await
|
||||
@ -48,10 +48,11 @@ SELECT u.name, CAST(SUM(l.distance_in_km) AS INTEGER) AS rowed_km
|
||||
FROM user u
|
||||
INNER JOIN rower r ON u.id = r.rower_id
|
||||
INNER JOIN logbook l ON r.logbook_id = l.id
|
||||
WHERE u.is_guest = 0 AND l.distance_in_km IS NOT NULL AND l.arrival LIKE '{year}-%'
|
||||
WHERE u.is_guest = 0 AND l.distance_in_km IS NOT NULL AND l.arrival LIKE '{}-%'
|
||||
GROUP BY u.name
|
||||
ORDER BY rowed_km DESC;
|
||||
"
|
||||
",
|
||||
year
|
||||
))
|
||||
.fetch_all(db)
|
||||
.await
|
||||
|
@ -182,7 +182,7 @@ async fn create_logbook(
|
||||
Err(LogbookCreateError::ShipmasterNotInRowers) => Flash::error(Redirect::to("/log"), "Schiffsführer nicht in Liste der Ruderer!"),
|
||||
Err(LogbookCreateError::NotYourEntry) => Flash::error(Redirect::to("/log"), "Nicht deine Ausfahrt!"),
|
||||
Err(LogbookCreateError::ArrivalSetButNotRemainingTwo) => Flash::error(Redirect::to("/log"), "Ankunftszeit gesetzt aber nicht Distanz + Strecke"),
|
||||
Err(LogbookCreateError::OnlyAllowedToEndTripsEndingToday) => Flash::error(Redirect::to("/log"), "Nur Ausfahrten, die heute enden dürfen eingetragen werden. Für einen Nachtrag schreibe alle Daten Philipp (Tel. nr. siehe Signal oder it@rudernlinz.at)."),
|
||||
Err(LogbookCreateError::OnlyAllowedToEndTripsEndingToday) => Flash::error(Redirect::to("/log"), format!("Nur Ausfahrten, die heute enden dürfen eingetragen werden. Für einen Nachtrag schreibe alle Daten Philipp (Tel. nr. siehe Signal oder it@rudernlinz.at).")),
|
||||
|
||||
}
|
||||
}
|
||||
@ -252,7 +252,7 @@ async fn home_logbook(
|
||||
match logbook.home(db, &user.user, data.into_inner()).await {
|
||||
Ok(_) => Flash::success(Redirect::to("/log"), "Ausfahrt korrekt eingetragen"),
|
||||
Err(LogbookUpdateError::TooManyRowers(expected, actual)) => Flash::error(Redirect::to("/log"), format!("Zu viele Ruderer (Boot fasst maximal {expected}, es wurden jedoch {actual} Ruderer ausgewählt)")),
|
||||
Err(LogbookUpdateError::OnlyAllowedToEndTripsEndingToday) => Flash::error(Redirect::to("/log"), "Nur Ausfahrten, die heute enden dürfen eingetragen werden. Für einen Nachtrag schreibe alle Daten Philipp (Tel. nr. siehe Signal oder it@rudernlinz.at)."),
|
||||
Err(LogbookUpdateError::OnlyAllowedToEndTripsEndingToday) => Flash::error(Redirect::to("/log"), format!("Nur Ausfahrten, die heute enden dürfen eingetragen werden. Für einen Nachtrag schreibe alle Daten Philipp (Tel. nr. siehe Signal oder it@rudernlinz.at).")),
|
||||
Err(e) => Flash::error(
|
||||
Redirect::to("/log"),
|
||||
format!("Eintrag {logbook_id} konnte nicht abgesendet werden (Fehler: {e:?})!"),
|
||||
|
Loading…
Reference in New Issue
Block a user