flake-tracker/src/templates.rs

39 lines
740 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::{
FlakeUri,
2025-02-01 19:38:47 +01:00
InputModel,
2025-02-08 15:53:25 +01:00
InputForFlakeRow,
RevisionListModel,
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.html")]
pub struct FlakeTemplate {
2025-02-01 19:00:51 +01:00
pub uri: String,
pub revisions: Vec<RevisionListModel>,
2025-02-08 15:53:25 +01:00
pub current_inputs: Vec<InputForFlakeRow>,
2025-02-01 19:00:51 +01:00
}
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>,
pub input_of: Vec<InputModel>,
2025-02-01 19:38:47 +01:00
}