fix large table overview; Fixes #30
All checks were successful
CI/CD Pipeline / test (push) Successful in 4m6s
CI/CD Pipeline / deploy (push) Successful in 2m46s

This commit is contained in:
Philipp Hofer 2025-04-13 21:43:44 +02:00
parent c34f2c1ac4
commit 4cbd5269d6
4 changed files with 115 additions and 103 deletions

View File

@ -23,6 +23,7 @@ async fn highscore(State(db): State<Arc<SqlitePool>>, session: Session) -> Marku
details open[idx==0] { details open[idx==0] {
summary { (route.name) } summary { (route.name) }
div class="overflow-auto" {
table { table {
thead { thead {
tr { tr {
@ -35,6 +36,7 @@ async fn highscore(State(db): State<Arc<SqlitePool>>, session: Session) -> Marku
} }
} }
td { "Gesamtpunkte" } td { "Gesamtpunkte" }
td { "Team" }
} }
} }
tbody { tbody {
@ -64,6 +66,12 @@ async fn highscore(State(db): State<Arc<SqlitePool>>, session: Session) -> Marku
} }
} }
td { (total_points) } td { (total_points) }
td {
a href=(format!("/admin/team/{}", team.id)) {
(team.name)
}
}
}
} }
} }
} }

View File

@ -147,9 +147,10 @@ DROP TABLE temp_pos;",
} }
async fn stations_not_in_route(&self, db: &SqlitePool) -> Vec<Station> { async fn stations_not_in_route(&self, db: &SqlitePool) -> Vec<Station> {
// TODO: switch to macro
sqlx::query_as::<_, Station>( sqlx::query_as::<_, Station>(
" "
SELECT id, name, notes, amount_people, last_login, pw, lat, lng SELECT id, name, notes, amount_people, last_login, pw, lat, lng, ready
FROM station FROM station
WHERE id NOT IN ( WHERE id NOT IN (
SELECT station_id SELECT station_id

View File

@ -175,6 +175,7 @@ async fn view(
@if !ratings.is_empty() { @if !ratings.is_empty() {
h2 { "Bewertungen" } h2 { "Bewertungen" }
div class="overflow-auto" {
table { table {
thead { thead {
tr { tr {
@ -231,6 +232,7 @@ async fn view(
} }
} }
} }
}

View File

@ -1,18 +1,17 @@
use super::{CreateError, LastContactTeam, Team}; use super::{CreateError, LastContactTeam, Team};
use crate::{ use crate::{
AppState,
admin::{route::Route, station::Station}, admin::{route::Route, station::Station},
err, err,
partials::page, partials::page,
pl, succ, pl, succ, AppState,
}; };
use axum::{ use axum::{
Form, Router,
extract::State, extract::State,
response::{IntoResponse, Redirect}, response::{IntoResponse, Redirect},
routing::{get, post}, routing::{get, post},
Form, Router,
}; };
use maud::{Markup, PreEscaped, html}; use maud::{html, Markup, PreEscaped};
use serde::Deserialize; use serde::Deserialize;
use sqlx::SqlitePool; use sqlx::SqlitePool;
use std::sync::Arc; use std::sync::Arc;
@ -462,6 +461,7 @@ async fn lost(State(db): State<Arc<SqlitePool>>, session: Session) -> Markup {
a href="/admin/team" { "↩️" } a href="/admin/team" { "↩️" }
"Teams: Letzter Kontakt" "Teams: Letzter Kontakt"
} }
div class="overflow-auto" {
table { table {
thead { thead {
tr { tr {
@ -494,6 +494,7 @@ async fn lost(State(db): State<Arc<SqlitePool>>, session: Session) -> Markup {
} }
} }
} }
}
}; };
page(content, session, false).await page(content, session, false).await