// SPDX-License-Identifier: AGPL-3.0-or-later package web // Inbox is the owner's inbox: what is open across every repository. The // counters, the filter and the lists are fragments with an id that the live // stream replaces as a whole (ermiteLive.swap). templ Inbox(l Layout, p InboxPage) { @Shell(l, nil) {

Inbox

@InboxCounters(p) @InboxRepos(p) @InboxPending(p) @InboxMRs(p) @InboxIssues(p)
} } templ InboxCounters(p InboxPage) {

{ itoa(p.MergeRequests) } merge requests · { itoa(p.Issues) } issues · { itoa(p.PendingCount) } awaiting moderation

} templ InboxRepos(p InboxPage) { } // InboxPending is the issues awaiting moderation, first on the page. Their // texts come from anonymous visitors: they are shown as plain text, escaped, // never as Markdown. templ InboxPending(p InboxPage) {

Awaiting moderation{ itoa(p.PendingCount) }

if len(p.Pending) > 0 { } else {

nothing awaits moderation.

}
} templ InboxMRs(p InboxPage) {

Open merge requests{ itoa(len(p.MRs)) }

@inboxRows(p.MRs, "Open merge requests") if len(p.MRs) == 0 {

no open merge requests.

}
} templ InboxIssues(p InboxPage) {

Open issues{ itoa(len(p.IssueRows)) }

@inboxRows(p.IssueRows, "Open issues") if len(p.IssueRows) == 0 {

no open issues.

}
} templ inboxRows(rows []InboxRow, label string) { if len(rows) > 0 { for _, m := range rows { }
{ m.Number } { m.Title } { m.Repo } if m.WhenAt != "" { }
} }