diff --git a/2026-01-12_16:52.patch b/2026-01-12_16:52.patch new file mode 100644 index 0000000..d4e4bee --- /dev/null +++ b/2026-01-12_16:52.patch @@ -0,0 +1,67 @@ +diff --git a/src/web/mod.rs b/src/web/mod.rs +index f919e6e..4f03aa9 100644 +--- a/src/web/mod.rs ++++ b/src/web/mod.rs +@@ -11,6 +11,7 @@ pub async fn start() -> anyhow::Result<()> { + let addr = "0.0.0.0:3000"; + let app = Router::new() + .route("/", get(pages::home::get_page)) ++ .route("/login", get(pages::login::get_page)) + .nest_service( + "/static", + ServiceBuilder::new() +diff --git a/src/web/pages/mod.rs b/src/web/pages/mod.rs +index 0c1f8ad..d4fc7a0 100644 +--- a/src/web/pages/mod.rs ++++ b/src/web/pages/mod.rs +@@ -1,6 +1,8 @@ + + ++ + pub mod home; ++pub mod login; + pub mod error; + + +diff --git a/templates/base.html b/templates/base.html +index 6731e87..86574ca 100644 +--- a/templates/base.html ++++ b/templates/base.html +@@ -3,6 +3,7 @@ + + + {{ self.title() }} ++ + + + {% include "header.html" %} +diff --git a/templates/header.html b/templates/header.html +index c247db4..cf4fb71 100644 +--- a/templates/header.html ++++ b/templates/header.html +@@ -1,6 +1,25 @@ +
+ + ++ + + +
diff --git a/2026-01-12_16:55.patch b/2026-01-12_16:55.patch new file mode 100644 index 0000000..d4e4bee --- /dev/null +++ b/2026-01-12_16:55.patch @@ -0,0 +1,67 @@ +diff --git a/src/web/mod.rs b/src/web/mod.rs +index f919e6e..4f03aa9 100644 +--- a/src/web/mod.rs ++++ b/src/web/mod.rs +@@ -11,6 +11,7 @@ pub async fn start() -> anyhow::Result<()> { + let addr = "0.0.0.0:3000"; + let app = Router::new() + .route("/", get(pages::home::get_page)) ++ .route("/login", get(pages::login::get_page)) + .nest_service( + "/static", + ServiceBuilder::new() +diff --git a/src/web/pages/mod.rs b/src/web/pages/mod.rs +index 0c1f8ad..d4fc7a0 100644 +--- a/src/web/pages/mod.rs ++++ b/src/web/pages/mod.rs +@@ -1,6 +1,8 @@ + + ++ + pub mod home; ++pub mod login; + pub mod error; + + +diff --git a/templates/base.html b/templates/base.html +index 6731e87..86574ca 100644 +--- a/templates/base.html ++++ b/templates/base.html +@@ -3,6 +3,7 @@ + + + {{ self.title() }} ++ + + + {% include "header.html" %} +diff --git a/templates/header.html b/templates/header.html +index c247db4..cf4fb71 100644 +--- a/templates/header.html ++++ b/templates/header.html +@@ -1,6 +1,25 @@ +
+ + ++ + + +
diff --git a/src/web/mod.rs b/src/web/mod.rs index f919e6e..4f03aa9 100644 --- a/src/web/mod.rs +++ b/src/web/mod.rs @@ -11,6 +11,7 @@ pub async fn start() -> anyhow::Result<()> { let addr = "0.0.0.0:3000"; let app = Router::new() .route("/", get(pages::home::get_page)) + .route("/login", get(pages::login::get_page)) .nest_service( "/static", ServiceBuilder::new() diff --git a/src/web/pages/login.rs b/src/web/pages/login.rs new file mode 100644 index 0000000..e824252 --- /dev/null +++ b/src/web/pages/login.rs @@ -0,0 +1,48 @@ +use askama::Template; +use axum::response::{Html, IntoResponse, Response}; + +use axum::{ + routing::{get, post}, + http::StatusCode, + Json, Router, +}; + +use crate::web::pages::{BaseTemplate, BaseTemplateCtx}; + +#[derive(Template)] +#[template(path = "login.html")] +pub struct HomeTemplate { + pub ctx: BaseTemplateCtx, + +} + +impl BaseTemplate for HomeTemplate { + fn ctx(&self) -> &BaseTemplateCtx { + &self.ctx + } + fn ctx_mut(&mut self) -> &mut BaseTemplateCtx { + &mut self.ctx + } + +} + +#[axum::debug_handler] +pub async fn get_page() -> Response { + fn inner() -> anyhow::Result<(StatusCode, String)> { + let mut template = HomeTemplate { + ctx: Default::default() + }; + + template.set_title("Login"); + + Ok((StatusCode::OK, template.render()?)) + } + + match inner() { + Ok((status, s)) => (status, Html(s)).into_response(), + Err(e) => { + let s = crate::web::pages::error::get_error_page(e.to_string()).await; + (StatusCode::INTERNAL_SERVER_ERROR, Html(s)).into_response() + } + } +} diff --git a/src/web/pages/mod.rs b/src/web/pages/mod.rs index 0c1f8ad..d4fc7a0 100644 --- a/src/web/pages/mod.rs +++ b/src/web/pages/mod.rs @@ -1,6 +1,8 @@ + pub mod home; +pub mod login; pub mod error; diff --git a/static/index.css b/static/index.css new file mode 100644 index 0000000..3eda125 --- /dev/null +++ b/static/index.css @@ -0,0 +1,70 @@ +body,html { + font-family: sans-serif; + margin: 0; + padding: 0; +} + +.nav { + display: flex; + list-style: none; + gap: 10px; + background: gray; + padding: 8px; + margin: 0px; +} + +.right { + margin-left: auto; +} + +.pfp { + width: 25px; + height: 25px; + object-fit: cover; + vertical-align: middle; + margin-right: 5px; + +} + +.nav a { + font-weight: bold; + text-decoration: none; + color: white; + background: gray; + vertical-align: middle; + +} + +.nav a:hover { + color: #FFFF88 +} + +footer { + position: absolute; + bottom: 0px; + width: 100%; + padding: 5px; + padding-left: 10px; + background: gray; + color: white; + +} + +.login-form { + + background: gray; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + padding: 10px; +} + +.login-form input[type="email"],input[type="password"] { + width: 95%; +} + +.login-form input[type="submit"] { + width: 98%; + margin-top: 10px; +} diff --git a/static/usericon.png b/static/usericon.png new file mode 100644 index 0000000..0834409 Binary files /dev/null and b/static/usericon.png differ diff --git a/templates/base.html b/templates/base.html index 6731e87..86574ca 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,6 +3,7 @@ {{ self.title() }} + {% include "header.html" %} diff --git a/templates/header.html b/templates/header.html index c247db4..cf4fb71 100644 --- a/templates/header.html +++ b/templates/header.html @@ -1,6 +1,25 @@
+
diff --git a/templates/login.html b/templates/login.html new file mode 100644 index 0000000..44f83f6 --- /dev/null +++ b/templates/login.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block content %} + +
+ + +
+ + + +
+ +{% endblock %}