fancier boat stats
This commit is contained in:
@ -3,15 +3,15 @@ use rocket_dyn_templates::{context, Template};
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
use crate::model::{
|
||||
stat::{self, Stat},
|
||||
stat::{self, BoatStat, Stat},
|
||||
user::{DonauLinzUser, UserWithRoles},
|
||||
};
|
||||
|
||||
use super::log::KioskCookie;
|
||||
|
||||
#[get("/boats?<year>", rank = 2)]
|
||||
async fn index_boat(db: &State<SqlitePool>, user: DonauLinzUser, year: Option<i32>) -> Template {
|
||||
let stat = Stat::boats(db, year).await;
|
||||
#[get("/boats", rank = 2)]
|
||||
async fn index_boat(db: &State<SqlitePool>, user: DonauLinzUser) -> Template {
|
||||
let stat = BoatStat::get(db).await;
|
||||
let kiosk = false;
|
||||
|
||||
Template::render(
|
||||
@ -20,13 +20,9 @@ async fn index_boat(db: &State<SqlitePool>, user: DonauLinzUser, year: Option<i3
|
||||
)
|
||||
}
|
||||
|
||||
#[get("/boats?<year>")]
|
||||
async fn index_boat_kiosk(
|
||||
db: &State<SqlitePool>,
|
||||
_kiosk: KioskCookie,
|
||||
year: Option<i32>,
|
||||
) -> Template {
|
||||
let stat = Stat::boats(db, year).await;
|
||||
#[get("/boats")]
|
||||
async fn index_boat_kiosk(db: &State<SqlitePool>, _kiosk: KioskCookie) -> Template {
|
||||
let stat = BoatStat::get(db).await;
|
||||
let kiosk = true;
|
||||
|
||||
Template::render("stat.boats", context!(stat, kiosk, show_kiosk_header: true))
|
||||
|
Reference in New Issue
Block a user