mini-player: implemented
This commit is contained in:
parent
55fa3b9196
commit
36208255b2
10 changed files with 81 additions and 23 deletions
|
|
@ -1,3 +1,4 @@
|
|||
pub mod index;
|
||||
pub mod miniplayer;
|
||||
pub mod music;
|
||||
pub mod notfound;
|
||||
|
|
|
|||
21
src/templates/music.rs
Normal file
21
src/templates/music.rs
Normal 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())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue