mirror of
https://seed.radicle.dev/rad:zwTxygwuz5LDGBq255RA2CbNGrz8.git
synced 2026-11-22 03:10:37 +08:00
refactor: add a helper function to add an H1 element
Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
+7
-3
@@ -121,7 +121,7 @@ impl PageData {
|
||||
|
||||
doc.push_to_body(Element::new(Tag::H1).with_text(&title));
|
||||
|
||||
doc.push_to_body(Element::new(Tag::H2).with_text("Broker status"));
|
||||
Self::h1(&mut doc, "Broker status");
|
||||
doc.push_to_body(
|
||||
Element::new(Tag::P)
|
||||
.with_text("Last updated: ")
|
||||
@@ -134,7 +134,7 @@ impl PageData {
|
||||
.with_text(")"),
|
||||
);
|
||||
|
||||
doc.push_to_body(Element::new(Tag::H2).with_text("Repositories"));
|
||||
Self::h1(&mut doc, "Repositories");
|
||||
|
||||
doc.push_to_body(Element::new(Tag::P).with_text("Latest CI run for each repository."));
|
||||
|
||||
@@ -226,7 +226,7 @@ impl PageData {
|
||||
}
|
||||
doc.push_to_body(list);
|
||||
|
||||
doc.push_to_body(Element::new(Tag::H2).with_text("Recent status"));
|
||||
Self::h1(&mut doc, "Recent status");
|
||||
let status = StatusData::from(self).as_json()?;
|
||||
doc.push_to_body(
|
||||
Element::new(Tag::P)
|
||||
@@ -255,6 +255,10 @@ impl PageData {
|
||||
);
|
||||
}
|
||||
|
||||
fn h1(page: &mut HtmlPage, text: &str) {
|
||||
page.push_to_body(Element::new(Tag::H2).with_text(text));
|
||||
}
|
||||
|
||||
fn whence_as_html(whence: &Whence) -> Element {
|
||||
match whence {
|
||||
Whence::Branch {
|
||||
|
||||
Reference in New Issue
Block a user