forked from Ruderverein-Donau-Linz/rowt
faq own page
This commit is contained in:
@@ -52,6 +52,19 @@ async fn index(db: &State<SqlitePool>, user: User, flash: Option<FlashMessage<'_
|
||||
Template::render("index", context.into_json())
|
||||
}
|
||||
|
||||
#[get("/faq")]
|
||||
async fn faq(db: &State<SqlitePool>, user: User, flash: Option<FlashMessage<'_>>) -> Template {
|
||||
let mut context = Context::new();
|
||||
|
||||
if let Some(msg) = flash {
|
||||
context.insert("flash", &msg.into_inner());
|
||||
}
|
||||
|
||||
context.insert("loggedin_user", &UserWithDetails::from_user(user, db).await);
|
||||
|
||||
Template::render("faq", context.into_json())
|
||||
}
|
||||
|
||||
#[get("/notifications")]
|
||||
async fn notifications(
|
||||
db: &State<SqlitePool>,
|
||||
@@ -235,7 +248,7 @@ async fn remove(db: &State<SqlitePool>, trip_details_id: i64, user: User) -> Fla
|
||||
}
|
||||
|
||||
pub fn routes() -> Vec<Route> {
|
||||
routes![index, join, remove, remove_guest, notifications]
|
||||
routes![index, join, remove, remove_guest, notifications, faq]
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
Reference in New Issue
Block a user