diff --git a/src/routes/cours.rs b/src/routes/cours.rs index 2691aef..1659d90 100644 --- a/src/routes/cours.rs +++ b/src/routes/cours.rs @@ -1,9 +1,44 @@ -use actix_web::{get, Responder}; +use actix_web::{get, web, Responder}; +use ramhorns::Content; + +use crate::{ + config::Config, + misc::utils::{make_kw, Html}, + template::{Infos, NavBar}, +}; #[get("/cours")] -async fn page() -> impl Responder { - // Page de notes de cours - // Cf. https://univ.mylloon.fr/ - // Cf. https://github.com/xy2z/PineDocs - actix_web::web::Redirect::to("/") +async fn page(config: web::Data) -> impl Responder { + Html(build_page(config.get_ref().to_owned())) +} + +#[derive(Content, Debug)] +struct CoursTemplate { + navbar: NavBar, +} + +// #[once(time = 60)] +fn build_page(config: Config) -> String { + config.tmpl.render( + "cours.html", + CoursTemplate { + navbar: NavBar { + cours: true, + ..NavBar::default() + }, + }, + Infos { + page_title: Some("Cours".into()), + page_desc: Some("Cours à l'univ".into()), + page_kw: make_kw(&[ + "cours", + "études", + "université", + "licence", + "master", + "notes", + "digital garden", + ]), + }, + ) } diff --git a/static/css/cours.css b/static/css/cours.css new file mode 100644 index 0000000..e69de29 diff --git a/templates/cours.html b/templates/cours.html new file mode 100644 index 0000000..79e33ee --- /dev/null +++ b/templates/cours.html @@ -0,0 +1,17 @@ + + + + {{>head.html}} + + + +
{{>navbar.html}}
+
+ {{#data}} + +

Coucou

+ + {{/data}} +
+ + diff --git a/templates/navbar.html b/templates/navbar.html index 70c5903..82f5e2d 100644 --- a/templates/navbar.html +++ b/templates/navbar.html @@ -45,9 +45,8 @@

Cours