// SPDX-License-Identifier: AGPL-3.0-or-later package web // The fragments of the live updates (events.go). Each is a top-level element // with an id: the page swaps the element that has the same id. // FactValue is the value of a fact; its id, when it has one, is the target of // the live updates ("last push"). templ FactValue(f Fact) {
if f.Time != "" { } else { { f.Val } }
} // RepoGone replaces the row of a repository that is deleted or not visible // any more; the page removes the element. templ RepoGone(id string) { } // RefsBody is the rows of the refs table. templ RefsBody(p RefsPage) { for _, b := range p.Branches { @refRow("branch", b) } for _, t := range p.Tags { @refRow("tag", t) } } // RefsKV is the facts of the rail of the refs page. templ RefsKV(p RefsPage) {
default
{ p.Default }
branches
{ itoa(len(p.Branches)) }
tags
{ itoa(len(p.Tags)) }
if p.Latest != "" {
latest tag
{ p.Latest }
}
} // CommitsSlot is the place of the banner of the commits page, empty. templ CommitsSlot() {
} // CommitsBanner announces new commits on the branch the page lists. It links // to the first page of the branch. templ CommitsBanner(text, href string) {
{ text }
} // MRNotice tells a merge request page that it is out of date. The empty slot // of the page has the same id, so the first notice replaces it. templ MRNotice(text, href string) {
{ text }
} // Live is the connection to the event stream, in the hint badge. It shows // only once a connection was lost: a page that never connected, or that is // live, says nothing. The events of the stream are fragments that ermiteLive // (ermite.js) swaps in the page. A page without a stream renders nothing. templ Live(l Layout) { if l.Live && l.LiveURL != "" { } }