mini-player: finished implementation, now need to keep trakc of state

This commit is contained in:
Agahnim 2026-03-20 14:18:12 +01:00
parent b4f861e79b
commit 823308d6eb
Signed by: Agahnim
SSH key fingerprint: SHA256:Zj65PJnE0dRYye8Ltk/qDglynyXUxJngQ9qqx/VI+b4
9 changed files with 320 additions and 48 deletions

View file

@ -2,7 +2,7 @@ use std::sync::Arc;
use agahnim_web_v2::{
domain::AppState,
templates::{index::home, miniplayer::miniplayer, music::music, notfound::notfound},
templates::{home::home, miniplayer::miniplayer, music::music, notfound::notfound},
};
use axum::{Router, routing::get};
use tower_http::services::ServeDir;

View file

@ -5,17 +5,17 @@ use axum::{
};
#[derive(Template)]
#[template(path = "index.html")]
struct IndexTemplate;
#[template(path = "home.html")]
struct HomeTemplate;
#[derive(Template)]
#[template(path = "partials/index.html")]
struct IndexPartialTemplate;
#[template(path = "partials/home.html")]
struct HomePartialTemplate;
pub async fn home(headers: HeaderMap) -> impl IntoResponse {
if headers.contains_key("hx-request") {
Html(IndexPartialTemplate.render().unwrap())
Html(HomePartialTemplate.render().unwrap())
} else {
Html(IndexTemplate.render().unwrap())
Html(HomeTemplate.render().unwrap())
}
}

View file

@ -1,4 +1,4 @@
pub mod index;
pub mod home;
pub mod miniplayer;
pub mod music;
pub mod notfound;