mini-player: implemented

This commit is contained in:
Agahnim 2026-03-20 11:28:11 +01:00
parent 55fa3b9196
commit 36208255b2
10 changed files with 81 additions and 23 deletions

View file

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

21
src/templates/music.rs Normal file
View file

@ -0,0 +1,21 @@
use askama::Template;
use axum::{
http::HeaderMap,
response::{Html, IntoResponse},
};
#[derive(Template)]
#[template(path = "music.html")]
struct MusicTemplate;
#[derive(Template)]
#[template(path = "partials/music.html")]
struct MusicPartialTemplate;
pub async fn music(headers: HeaderMap) -> impl IntoResponse {
if headers.contains_key("hx-request") {
Html(MusicPartialTemplate.render().unwrap())
} else {
Html(MusicTemplate.render().unwrap())
}
}