// 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) {
}
// 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) {
}
// Live is the connection state of the event stream, in the status bar.
// Without a stream it reads "offline" and does nothing. The events of the
// stream are fragments that ermiteLive (ermite.js) swaps in the page.
templ Live(l Layout) {
if l.Live && l.LiveURL != "" {
offline
} else {
offline
}
}