show header in kiosk mode

This commit is contained in:
philipp 2023-10-23 21:05:59 +02:00
parent 4cb374e246
commit 6f9edfa23f
4 changed files with 11 additions and 3 deletions

View File

@ -36,6 +36,7 @@ async fn index_kiosk(
context.insert("boatdamages", &boatdamages); context.insert("boatdamages", &boatdamages);
context.insert("boats", &boats); context.insert("boats", &boats);
context.insert("coxes", &coxes); context.insert("coxes", &coxes);
context.insert("show_kiosk_header", &true);
Template::render("boatdamages", context.into_json()) Template::render("boatdamages", context.into_json())
} }

View File

@ -90,7 +90,7 @@ async fn show(db: &State<SqlitePool>, user: User) -> Template {
async fn show_kiosk(db: &State<SqlitePool>, _kiosk: KioskCookie) -> Template { async fn show_kiosk(db: &State<SqlitePool>, _kiosk: KioskCookie) -> Template {
let logs = Logbook::completed(db).await; let logs = Logbook::completed(db).await;
Template::render("log.completed", context!(logs)) Template::render("log.completed", context!(logs, show_kiosk_header: true))
} }
#[get("/kiosk/ekrv2019/<loc>")] #[get("/kiosk/ekrv2019/<loc>")]
@ -148,6 +148,7 @@ async fn kiosk(
context.insert("logtypes", &logtypes); context.insert("logtypes", &logtypes);
context.insert("on_water", &on_water); context.insert("on_water", &on_water);
context.insert("distances", &distances); context.insert("distances", &distances);
context.insert("show_kiosk_header", &true);
Template::render("kiosk", context.into_json()) Template::render("kiosk", context.into_json())
} }

View File

@ -26,7 +26,7 @@ async fn index_kiosk(db: &State<SqlitePool>, _kiosk: KioskCookie) -> Template {
let stat = Stat::get_rowed_km(db).await; let stat = Stat::get_rowed_km(db).await;
let kiosk = true; let kiosk = true;
Template::render("stat", context!(stat, kiosk)) Template::render("stat", context!(stat, kiosk, show_kiosk_header: true))
} }
pub fn routes() -> Vec<Route> { pub fn routes() -> Vec<Route> {

View File

@ -12,7 +12,13 @@
<body class="bg-gray-100"> <body class="bg-gray-100">
{% if loggedin_user %} {% if loggedin_user %}
{{ macros::header(loggedin_user=loggedin_user) }} {{ macros::header(loggedin_user=loggedin_user) }}
{% endif %} {% endif %}
{% if show_kiosk_header %}
<a href="/log">Ausfahrt eintragen</a>
<a href="/log/show">Logbuch</a>
<a href="/stat">Statistik</a>
<a href="/boatdamage">Bootsschaden</a>
{% endif %}
<div class="flex min-h-screen {%if not loggedin_user %} items-center {% else %} items-start {% endif %} justify-center px-4 py-12 sm:px-6 lg:px-8"> {% block content %}{% endblock content %} <div class="flex min-h-screen {%if not loggedin_user %} items-center {% else %} items-start {% endif %} justify-center px-4 py-12 sm:px-6 lg:px-8"> {% block content %}{% endblock content %}
</div> </div>