2023-06-05 14:15:17 +02:00
|
|
|
use rocket::{get, http::ContentType, routes, Route, State};
|
2023-05-24 15:36:38 +02:00
|
|
|
use rocket_dyn_templates::{context, Template};
|
|
|
|
use sqlx::SqlitePool;
|
|
|
|
|
|
|
|
use crate::model::{planned_event::PlannedEvent, user::User};
|
|
|
|
|
|
|
|
#[get("/faq")]
|
|
|
|
async fn faq(user: User) -> Template {
|
|
|
|
Template::render("faq", context!(loggedin_user: user))
|
|
|
|
}
|
|
|
|
|
|
|
|
#[get("/cal")]
|
2023-06-05 14:15:17 +02:00
|
|
|
async fn cal(db: &State<SqlitePool>) -> (ContentType, String) {
|
|
|
|
(ContentType::Calendar, PlannedEvent::get_ics_feed(db).await)
|
2023-05-24 15:36:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn routes() -> Vec<Route> {
|
|
|
|
routes![faq, cal]
|
|
|
|
}
|