Merge pull request 'fix-tetss' (#1098) from fix-tetss into staging
Reviewed-on: #1098
This commit was merged in pull request #1098.
	This commit is contained in:
		| @@ -431,7 +431,7 @@ WHERE family_id IS NULL; | |||||||
|             " |             " | ||||||
| SELECT id, name, pw, deleted, last_access, dob, weight, sex, member_since_date, birthdate, mail, nickname, phone, address, family_id, user_token | SELECT id, name, pw, deleted, last_access, dob, weight, sex, member_since_date, birthdate, mail, nickname, phone, address, family_id, user_token | ||||||
| FROM user | FROM user | ||||||
| WHERE deleted = 0 AND (SELECT COUNT(*) FROM user_role WHERE user_id=user.id AND role_id = (SELECT id FROM role WHERE name = 'cox')) > 0 | WHERE deleted = 0 AND (SELECT COUNT(*) FROM user_role WHERE user_id=user.id AND role_id in (SELECT id FROM role WHERE name = 'cox' or name = 'Bootsführer')) > 0 | ||||||
| ORDER BY last_access DESC | ORDER BY last_access DESC | ||||||
|         " |         " | ||||||
|         ) |         ) | ||||||
|   | |||||||
| @@ -62,7 +62,8 @@ async fn index_loggedin( | |||||||
|         &UserWithDetails::from_user(user.into_inner(), db).await, |         &UserWithDetails::from_user(user.into_inner(), db).await, | ||||||
|     ); |     ); | ||||||
|  |  | ||||||
|     index(db, flash, context).await |     let context = index(db, flash, context).await; | ||||||
|  |     Template::render("log", context.into_json()) | ||||||
| } | } | ||||||
|  |  | ||||||
| #[get("/")] | #[get("/")] | ||||||
| @@ -78,10 +79,11 @@ async fn index_kiosk( | |||||||
|  |  | ||||||
|     context.insert("show_kiosk_header", &true); |     context.insert("show_kiosk_header", &true); | ||||||
|  |  | ||||||
|     index(db, flash, context).await |     let context = index(db, flash, context).await; | ||||||
|  |     Template::render("kiosk", context.into_json()) | ||||||
| } | } | ||||||
|  |  | ||||||
| async fn index(db: &SqlitePool, flash: Option<FlashMessage<'_>>, mut context: Context) -> Template { | async fn index(db: &SqlitePool, flash: Option<FlashMessage<'_>>, mut context: Context) -> Context { | ||||||
|     if let Some(msg) = flash { |     if let Some(msg) = flash { | ||||||
|         context.insert("flash", &msg.into_inner()); |         context.insert("flash", &msg.into_inner()); | ||||||
|     } |     } | ||||||
| @@ -120,7 +122,7 @@ async fn index(db: &SqlitePool, flash: Option<FlashMessage<'_>>, mut context: Co | |||||||
|     context.insert("on_water", &on_water); |     context.insert("on_water", &on_water); | ||||||
|     context.insert("distances", &distances); |     context.insert("distances", &distances); | ||||||
|  |  | ||||||
|     Template::render("kiosk", context.into_json()) |     context | ||||||
| } | } | ||||||
|  |  | ||||||
| #[get("/show", rank = 3)] | #[get("/show", rank = 3)] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user