Port commit page

This commit is contained in:
Joscha 2023-08-13 21:19:43 +02:00
parent db0234b750
commit 373b3168f1
7 changed files with 111 additions and 19 deletions

View file

@ -1,4 +1,5 @@
use askama::Template;
use time::OffsetDateTime;
use crate::server::util;
@ -51,6 +52,25 @@ impl LinkRunShort {
}
}
#[derive(Template)]
#[template(
ext = "html",
source = "<a href=\"{{ link }}\">Run from {{ date }}</a>"
)]
pub struct LinkRunDate {
link: Link,
date: String, // TODO base.date(...)?
}
impl LinkRunDate {
pub fn new(base: &Base, id: String, start: OffsetDateTime) -> Self {
Self {
link: base.link(PathRunById { id }),
date: util::format_time(start),
}
}
}
#[derive(Template)]
#[template(ext = "html", source = "<a href=\"{{ link }}\">{{ name }}</a>")]
pub struct LinkWorker {