package templates
import "gitgud/internal/domain"
templ IssueDetail(user *domain.User, repo *domain.Repository, issue *domain.Issue, comments []*domain.IssueComment, canModify bool) {
@Layout(issue.Title+" · "+repo.Name, user) {
@repoHeader(repo, "issues")
{ issue.Title } #{ itoa(issue.Number) }
if issue.State == domain.IssueOpen {
Open
} else {
Closed
}
{ issue.AuthorName } opened this on { fmtTime(issue.CreatedAt) }
@commentCard(issue.AuthorName, fmtTime(issue.CreatedAt), issue.Body)
for _, c := range comments {
@commentCard(c.AuthorName, fmtTime(c.CreatedAt), c.Body)
}
if canModify {
}
if user != nil {
} else {
Sign in to comment.
}
}
}
templ commentCard(author, when, body string) {
@avatar(author, "size-5")
{ author }
commented on { when }
@templ.Raw(markdown(body))
}