3 Commits

Author SHA1 Message Date
59478a5ee1 Merge pull request 'fix tests' (#1099) from fix-tetss into main
Some checks failed
CI/CD Pipeline / test (push) Failing after 29m29s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #1099
2025-07-17 21:49:20 +02:00
2f5d483bff fix tests
Some checks failed
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
2025-07-17 21:48:31 +02:00
7be9339645 Merge pull request 'merge functionality of kiosk + logged in -> allow kiosk to have fördernde people as rower in logbook' (#1097) from kiosk-allow-foerdernde into main
Some checks failed
CI/CD Pipeline / test (push) Failing after 25m29s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #1097
2025-07-13 19:52:33 +02:00
2 changed files with 7 additions and 5 deletions

View File

@@ -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
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
"
)

View File

@@ -62,7 +62,8 @@ async fn index_loggedin(
&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("/")]
@@ -78,10 +79,11 @@ async fn index_kiosk(
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 {
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("distances", &distances);
Template::render("kiosk", context.into_json())
context
}
#[get("/show", rank = 3)]