diff --git a/src/pages.rs b/src/pages.rs index 56633f06..f94fbbc6 100644 --- a/src/pages.rs +++ b/src/pages.rs @@ -399,7 +399,7 @@ impl PageData { let mut table = Element::new(Tag::Table).with_class("run-list").with_child( Element::new(Tag::Tr) .with_child(Element::new(Tag::Th).with_text("Run ID")) - .with_child(Element::new(Tag::Th).with_text("Whence")) + .with_child(Element::new(Tag::Th).with_text("Triggered by")) .with_child(Element::new(Tag::Th).with_text("Status")) .with_child(Element::new(Tag::Th).with_text("Info")), ); @@ -547,18 +547,14 @@ impl PageData { name, commit, who: _, - } => Element::new(Tag::Span) + } => Element::span() .with_text("branch ") .with_child(Element::new(Tag::Code).with_class("branch").with_text(name)) .with_text(", commit ") - .with_child( - Element::new(Tag::Code) - .with_class("commit") - .with_text(commit.to_string()), - ) + .with_child(Self::commit_element(commit)) .with_child(Element::new(Tag::Br)) .with_child( - Element::new(Tag::Span) + Element::span() .with_class("who") .with_text(whence.who().unwrap_or("")), ), @@ -567,16 +563,16 @@ impl PageData { commit, revision, who: _, - } => Element::new(Tag::Span) + } => Element::span() .with_text("patch ") .with_child( - Element::new(Tag::Code) + Element::code() .with_class("patch") .with_text(patch.to_string()), ) .with_child(Element::new(Tag::Br)) .with_text("revision ") - .with_child(Element::new(Tag::Code).with_class("revision)").with_text(&{ + .with_child(Element::code().with_class("revision)").with_text(&{ if let Some(rev) = &revision { rev.to_string() } else { @@ -585,11 +581,7 @@ impl PageData { })) .with_child(Element::new(Tag::Br)) .with_text("commit ") - .with_child( - Element::new(Tag::Code) - .with_class("commit)") - .with_text(commit.to_string()), - ) + .with_child(Self::commit_element(commit)) .with_child(Element::new(Tag::Br)) .with_text("from ") .with_child( @@ -600,6 +592,17 @@ impl PageData { } } + fn commit_element(oid: &Oid) -> Element { + let commit = if let Some((prefix, _)) = oid.to_string().split_at_checked(7) { + prefix.to_string() + } else { + oid.to_string() + }; + Element::span() + .with_class("commit-id-prefix") + .with_text(commit) + } + fn repos(&self) -> Vec<(String, RepoId)> { let rids: HashSet<(String, RepoId)> = self .runs diff --git a/src/radicle-ci.css b/src/radicle-ci.css index 6e6e2c44..8fb59fec 100644 --- a/src/radicle-ci.css +++ b/src/radicle-ci.css @@ -50,6 +50,10 @@ code.repo-name { font-weight: bold; } +span.commit-id-prefix { + font-weight: bold; +} + span.broker-run-id { font-style: monospace; font-size: 80%;