// SPDX-License-Identifier: AGPL-3.0-or-later package web import "fmt" // Home is the repository list. templ Home(l Layout, p HomePage) { @Shell(l, nil) {

Repositories

if len(p.Rows) == 0 {

no repositories yet.

}
} } // Summary is the summary of a repository: the README reads in the main // column at the reading measure; what one acts on sits in the rail. templ Summary(l Layout, p SummaryPage) { @Shell(l, summaryRail(p)) { if p.Readme != nil { @ReadmeCard(*p.Readme, p.Docs...) } } } // latestTagFact is the "latest tag" row of About: the newest tag (its // commit subject on hover), how old it is, and the count of tags, a link to // all of them. With too many tags to date them, the count only. templ latestTagFact(t LatestTag) {
latest tag
if t.Name != "" { { t.Name } if t.WhenAt != "" { { " · " } } { " · " } } { plural(t.Count, "tag", "tags") }
} templ summaryRail(p SummaryPage) { if p.Mirror != nil {

Mirror

⚠ Mirror { p.Mirror.State }

if p.Mirror.Reason != "" {

{ p.Mirror.Reason }

}

Run { p.Mirror.Command }

}

Clone

@CloneBlock(p.Clone)

About

for _, f := range p.Facts {
{ f.Key }
@FactValue(f) } if lic := p.License; lic != nil {
license
{ lic.ID }
} if p.Latest != nil { @latestTagFact(*p.Latest) } if r := p.Release; r != nil {
release
{ r.Tag }{ " · " } { " · " } all releases
}
if len(p.Recent) > 0 {

Recent commits View all

@CommitRows(p.Recent)
} if p.Actions != nil { @RecentActionsBlock(*p.Actions) } if len(p.Outline) > 0 && p.Readme != nil {

On this page

@Outline(p.Outline)
} } // Refs lists the branches and tags of a repository. templ Refs(l Layout, p RefsPage) { @Shell(l, refsRail(p)) {
@RefsBody(p)
kindnamecommitsubjectdate
if p.Note != "" {

{ p.Note }

} } } templ refRow(kind string, r RefRow) { { kind } { r.Name } if r.Default { default } if r.CHref != "" { { r.Short } } else { { r.Short } } @CommitChecks(r.Checks) { r.Subject } if r.WhenAt != "" { } } templ refsRail(p RefsPage) {

Overview

@RefsKV(p)
} // State is a 404, 500 or empty-repository page inside the normal shell. templ State(l Layout, p StatePage) { @Shell(l, nil) {

{ p.Code }

{ p.Title }

for _, line := range p.Lines {

{ line }

} if p.Clone != nil { @CloneBlock(*p.Clone) }

for _, b := range p.Back { { b.Label } }

} } // Login signs the browser in with a login link. Opening the link consumes // nothing; only this form does. ermite.js submits it as soon as a browser // shows the page (data-autosubmit): link previews and prefetchers run no // script, so they still cannot use the link. Without scripts the owner // clicks the button. templ Login(l Layout, p LoginPage) { @Shell(l, nil) {

{ p.Title }

for _, line := range p.Lines {

{ line }

}

Back to home

} } // PasskeyLogin is the sign-in page: a button the script (passkey.js) drives. // Without script the button is hidden and the page says what to do instead. templ PasskeyLogin(l Layout, p PasskeyLoginPage) { @Shell(l, nil) {

{ p.Title }

for _, line := range p.Lines {

{ line }

}

Back to home

} } // Passkeys lists the owner's passkeys, removes them and adds one. templ Passkeys(l Layout, p PasskeysPage) { @Shell(l, nil) {

Passkeys{ itoa(len(p.Rows)) }

A passkey signs you in from this device or your phone, without a terminal. Removing one signs every browser out.

if len(p.Rows) > 0 { for _, r := range p.Rows { }
Name Created Last used Synced Remove
{ r.Name } if r.Synced { yes } else { no }
} else {

no passkeys yet.

} if p.Full {

{ itoa(p.Max) } passkeys are registered, the most there can be. Remove one to add another.

} else {
}

} }