show header in kiosk mode
This commit is contained in:
		@@ -36,6 +36,7 @@ async fn index_kiosk(
 | 
			
		||||
    context.insert("boatdamages", &boatdamages);
 | 
			
		||||
    context.insert("boats", &boats);
 | 
			
		||||
    context.insert("coxes", &coxes);
 | 
			
		||||
    context.insert("show_kiosk_header", &true);
 | 
			
		||||
 | 
			
		||||
    Template::render("boatdamages", context.into_json())
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -90,7 +90,7 @@ async fn show(db: &State<SqlitePool>, user: User) -> Template {
 | 
			
		||||
async fn show_kiosk(db: &State<SqlitePool>, _kiosk: KioskCookie) -> Template {
 | 
			
		||||
    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>")]
 | 
			
		||||
@@ -148,6 +148,7 @@ async fn kiosk(
 | 
			
		||||
    context.insert("logtypes", &logtypes);
 | 
			
		||||
    context.insert("on_water", &on_water);
 | 
			
		||||
    context.insert("distances", &distances);
 | 
			
		||||
    context.insert("show_kiosk_header", &true);
 | 
			
		||||
 | 
			
		||||
    Template::render("kiosk", context.into_json())
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@ async fn index_kiosk(db: &State<SqlitePool>, _kiosk: KioskCookie) -> Template {
 | 
			
		||||
    let stat = Stat::get_rowed_km(db).await;
 | 
			
		||||
    let kiosk = true;
 | 
			
		||||
 | 
			
		||||
    Template::render("stat", context!(stat, kiosk))
 | 
			
		||||
    Template::render("stat", context!(stat, kiosk, show_kiosk_header: true))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub fn routes() -> Vec<Route> {
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,13 @@
 | 
			
		||||
	<body class="bg-gray-100">
 | 
			
		||||
		{% if 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>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user