flake-tracker/src/templates.rs

39 lines
740 B
Rust

use askama::{
Template,
};
use crate::{
storage::{
FlakeUri,
InputModel,
InputForFlakeRow,
RevisionListModel,
},
};
#[derive(Template)]
#[template(path = "index.html")]
pub struct IndexTemplate {
}
#[derive(Template)]
#[template(path = "flakes.html")]
pub struct FlakesTemplate {
pub flakes: Vec<FlakeUri>,
}
#[derive(Template)]
#[template(path = "flake.html")]
pub struct FlakeTemplate {
pub uri: String,
pub revisions: Vec<RevisionListModel>,
pub current_inputs: Vec<InputForFlakeRow>,
}
#[derive(Template)]
#[template(path = "revision.html")]
pub struct RevisionTemplate {
pub revision_uri: String,
pub inputs: Vec<InputModel>,
pub input_of: Vec<InputModel>,
}