// SPDX-License-Identifier: AGPL-3.0-or-later package web // Home is the repository list. templ Home(l Layout, p HomePage) { @Shell(l, nil) {
for _, c := range p.Cols { } for _, r := range p.Rows { @HomeRowView(r) }
{ c.Label } if c.Mark != "" { }
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) } } } templ summaryRail(p SummaryPage) {

Clone

@CloneBlock(p.Clone)

About

@Facts(p.Facts)
if p.Latest != nil {

Tags { itoa(p.Latest.Count) } View all

if p.Latest.Name != "" {
{ p.Latest.Name } latest if p.Latest.Subject != "" {

{ p.Latest.Subject }

}
} else {

{ plural(p.Latest.Count, "tag", "tags") }

}
} 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 asks the owner to confirm a login link. Opening the link consumes // nothing; only this form does. It is a state page with a 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 {
}

} }