show which teams to take to first station; Fixes #29
This commit is contained in:
parent
2a1d0a7616
commit
c34f2c1ac4
@ -2,3 +2,4 @@
|
|||||||
|
|
||||||
## Marketing
|
## Marketing
|
||||||
- single-binary (+ db + .env)
|
- single-binary (+ db + .env)
|
||||||
|
- Teams werden automatisch (start)stationen zugewiesen
|
||||||
|
@ -130,9 +130,10 @@ DROP TABLE temp_pos;",
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn stations(&self, db: &SqlitePool) -> Vec<Station> {
|
pub(crate) async fn stations(&self, db: &SqlitePool) -> Vec<Station> {
|
||||||
|
// TODO: switch to macro
|
||||||
sqlx::query_as::<_, Station>(
|
sqlx::query_as::<_, Station>(
|
||||||
"
|
"
|
||||||
SELECT s.id, s.name, s.notes, s.amount_people, s.last_login, s.pw, s.lat, s.lng
|
SELECT s.id, s.name, s.notes, s.amount_people, s.last_login, s.pw, s.lat, s.lng, s.ready
|
||||||
FROM station s
|
FROM station s
|
||||||
JOIN route_station rs ON s.id = rs.station_id
|
JOIN route_station rs ON s.id = rs.station_id
|
||||||
WHERE rs.route_id = ?
|
WHERE rs.route_id = ?
|
||||||
|
@ -13,8 +13,8 @@ mod web;
|
|||||||
pub(crate) struct Team {
|
pub(crate) struct Team {
|
||||||
pub(crate) id: i64,
|
pub(crate) id: i64,
|
||||||
pub(crate) name: String,
|
pub(crate) name: String,
|
||||||
notes: Option<String>,
|
pub(crate) notes: Option<String>,
|
||||||
amount_people: Option<i64>,
|
pub(crate) amount_people: Option<i64>,
|
||||||
first_station_id: i64,
|
first_station_id: i64,
|
||||||
route_id: i64,
|
route_id: i64,
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,36 @@ async fn view(
|
|||||||
@if let (Some(lat), Some(lng)) = (station.lat, station.lng) {
|
@if let (Some(lat), Some(lng)) = (station.lat, station.lng) {
|
||||||
article {
|
article {
|
||||||
details open[(!station.ready)]{
|
details open[(!station.ready)]{
|
||||||
summary { "Stationsort" }
|
summary { "Infos" }
|
||||||
|
@let first_teams = Team::all_with_first_station(&db, &station).await;
|
||||||
|
@if first_teams.is_empty() {
|
||||||
|
"Du musst keine Teams zu deiner Station mitnehmen"
|
||||||
|
} @else{
|
||||||
|
b { (format!("Nimm bitte folgende {} Teams am Anfang zu deiner Station mit:", first_teams.len())) }
|
||||||
|
ol {
|
||||||
|
@for team in first_teams {
|
||||||
|
li {
|
||||||
|
b {
|
||||||
|
(team.name)
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
@if let Some(amount_people) = team.amount_people {
|
||||||
|
li {
|
||||||
|
(amount_people)
|
||||||
|
" Personen"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@if let Some(notes) = team.notes {
|
||||||
|
li {
|
||||||
|
(notes)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
b { "Hier befindet sich deine Station:" }
|
b { "Hier befindet sich deine Station:" }
|
||||||
div id="map" style="height: 500px" {}
|
div id="map" style="height: 500px" {}
|
||||||
script { (format!("
|
script { (format!("
|
||||||
|
Loading…
x
Reference in New Issue
Block a user