// SPDX-License-Identifier: AGPL-3.0-or-later package web // IssueList is the list of the issues of a repository, open or closed. templ IssueList(l Layout, p IssueListPage) { @Shell(l, issueListRail(p)) { if p.Live { @LiveSlot("mr-notice") }

if p.Closed { Closed } else { Open } { itoa(len(p.Rows)) }

@issueRows(p.Rows) if len(p.Rows) == 0 { if p.Closed {

no closed issues.

} else {

no open issues.

} } if p.Older != "" || p.Newest != "" { } } } templ issueRows(rows []IssueRow) { if len(rows) > 0 { for _, i := range rows { }
{ i.Number } { i.State } { i.Title } { i.Author } if i.WhenAt != "" { }
} } templ issueListRail(p IssueListPage) {

States

open
being worked on
closed
done with, can be reopened
if p.NewHref != "" {

Open one

New issue
} } // IssueNew is the form that opens an issue. templ IssueNew(l Layout, p IssueNewPage) { @Shell(l, issueNewRail()) {

New issue

Cancel
} } templ issueNewRail() {

Issues

issues share their numbers with the merge requests of the repository.

} // IssueShow is an issue: its facts, its body, its comments and, for the // owner, the form to comment and the button that closes or reopens it. templ IssueShow(l Layout, p IssuePage) { @Shell(l, issueRail(p)) {

{ p.Number } { p.Title }

state
{ p.State }
opened
{ p.Opened.Name } if p.Opened.WhenAt != "" { { " · " } }
if p.ClosedBy != nil {
closed by
{ p.ClosedBy.Label }
} if p.UpdatedAt != "" {
updated
}
if p.Desc != "" {
@templ.Raw(string(p.Desc))
}
if p.Live { @LiveSlot("mr-notice") }

Comments{ itoa(len(p.Comments)) }

for _, c := range p.Comments { @commentView(c, "") } if len(p.Comments) == 0 {

no comments yet.

} if p.Form != nil { @commentForm(*p.Form, "") } } } templ issueRail(p IssuePage) { if len(p.References) > 0 {

Merge requests

} if p.Transition != nil {

Issue

} }