diff --git a/src/web.rs b/src/web.rs index 82ea11d..8f6f334 100644 --- a/src/web.rs +++ b/src/web.rs @@ -1,6 +1,7 @@ mod commit; mod commit_hash; mod index; +mod queue; mod r#static; use axum::{routing::get, Router, Server}; @@ -10,6 +11,7 @@ use crate::{config::Config, somehow, state::AppState}; pub enum Tab { Index, Commit, + Queue, } pub struct Base { @@ -23,6 +25,7 @@ impl Base { let current = match tab { Tab::Index => "index", Tab::Commit => "commit", + Tab::Queue => "queue", }; Self { root: config.web.base(), @@ -39,6 +42,7 @@ pub async fn run(state: AppState) -> somehow::Result<()> { .route("/", get(index::get)) .route("/commit/", get(commit::get)) .route("/commit/:hash", get(commit_hash::get)) + .route("/queue/", get(queue::get)) .fallback(get(r#static::static_handler)) .with_state(state.clone()); diff --git a/src/web/queue.rs b/src/web/queue.rs new file mode 100644 index 0000000..b7fb171 --- /dev/null +++ b/src/web/queue.rs @@ -0,0 +1,18 @@ +use askama::Template; +use axum::{extract::State, response::IntoResponse}; + +use crate::{config::Config, somehow}; + +use super::{Base, Tab}; + +#[derive(Template)] +#[template(path = "queue.html")] +struct CommitTemplate { + base: Base, +} + +pub async fn get(State(config): State<&'static Config>) -> somehow::Result { + Ok(CommitTemplate { + base: Base::new(config, Tab::Queue), + }) +} diff --git a/templates/base.html b/templates/base.html index 0895921..54b0444 100644 --- a/templates/base.html +++ b/templates/base.html @@ -18,6 +18,9 @@ commit + + queue + {% block body %}{% endblock %} diff --git a/templates/queue.html b/templates/queue.html new file mode 100644 index 0000000..8270f7d --- /dev/null +++ b/templates/queue.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block title %}queue{% endblock %} + +{% block body %} +

Queue

+

Sorry, nothing here yet.

+{% endblock %}