diff --git a/src/main.rs b/src/main.rs index 6bc4879..52c7e56 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,6 +38,7 @@ async fn main() { let app = Router::new() .route("/", get(controllers::home)) + .route("/rules", get(controllers::rules)) .route("/openid/signin", post(controllers::signin)) .route("/openid/exchange-code", get(controllers::exchange_code)) .route("/logout", post(controllers::logout)) diff --git a/src/web/assets/css/layout.css b/src/web/assets/css/layout.css index 4ac9dfb..51a0fe0 100644 --- a/src/web/assets/css/layout.css +++ b/src/web/assets/css/layout.css @@ -59,8 +59,10 @@ nav .space { } footer { - margin-top: 64px; + border-top: 1px solid var(--input-border); + margin-top: 32px; margin-bottom: 64px; + padding-top: 20px; } footer .link-row { @@ -89,3 +91,10 @@ footer .link-row a { .pseudo-link:hover { text-decoration: underline; } + +hr { + border-top: 1px solid var(--input-border); + border-bottom: none; + margin-top: 32px; + margin-bottom: 32px; +} diff --git a/src/web/controllers/mod.rs b/src/web/controllers/mod.rs index 06e8472..b450480 100644 --- a/src/web/controllers/mod.rs +++ b/src/web/controllers/mod.rs @@ -5,12 +5,14 @@ mod error; mod home; mod images; mod openid; +mod rules; pub use admin::*; pub use auth::*; pub use home::*; pub use images::{delete_image, get_image, upload_image}; pub use openid::*; +pub use rules::*; use ctx::*; use error::*; diff --git a/src/web/controllers/rules.rs b/src/web/controllers/rules.rs new file mode 100644 index 0000000..2ce3ef3 --- /dev/null +++ b/src/web/controllers/rules.rs @@ -0,0 +1,14 @@ +use axum::{extract::State, response::Html}; +use axum_extra::extract::CookieJar; +use std::sync::Arc; + +use crate::web::templates; + +pub async fn rules( + cookies: CookieJar, + State(state): State>, +) -> Result, super::ControllerError> { + let ctx = super::get_context(&state.db, cookies).await?; + let resp = templates::render("rules.html", &ctx); + Ok(resp) +} diff --git a/src/web/templates/layout.html b/src/web/templates/layout.html index 517d905..f17a3a7 100644 --- a/src/web/templates/layout.html +++ b/src/web/templates/layout.html @@ -16,6 +16,7 @@