flake-tracker/src/templates.rs

36 lines
639 B
Rust
Raw Normal View History

2025-02-01 14:22:33 +01:00
use askama::{
Template,
};
2025-02-01 18:34:14 +01:00
use crate::{
storage::{
2025-02-01 19:00:51 +01:00
FlakeRevision,
2025-02-01 18:34:14 +01:00
FlakeUri,
2025-02-01 19:38:47 +01:00
InputModel,
2025-02-01 18:34:14 +01:00
},
};
2025-02-01 14:22:33 +01:00
#[derive(Template)]
#[template(path = "index.html")]
pub struct IndexTemplate {
}
2025-02-01 18:34:14 +01:00
#[derive(Template)]
#[template(path = "flakes.html")]
pub struct FlakesTemplate {
pub flakes: Vec<FlakeUri>,
}
2025-02-01 19:00:51 +01:00
#[derive(Template)]
#[template(path = "flake-info.html")]
pub struct FlakeInfoTemplate {
pub uri: String,
pub flake_revisions: Vec<FlakeRevision>,
}
2025-02-01 19:38:47 +01:00
#[derive(Template)]
#[template(path = "revision.html")]
pub struct RevisionTemplate {
pub revision_uri: String,
pub inputs: Vec<InputModel>,
}