{{ define "title" }}{{ .Issue.Title }} · issue #{{ .Issue.IssueId }} · {{ .RepoInfo.FullName }}{{ end }} {{ define "repoContent" }}

{{ .Issue.Title }} #{{ .Issue.IssueId }}

{{ $bgColor := "bg-gray-800 dark:bg-gray-700" }} {{ $icon := "ban" }} {{ if eq .State "open" }} {{ $bgColor = "bg-green-600 dark:bg-green-700" }} {{ $icon = "circle-dot" }} {{ end }}
{{ i $icon "w-4 h-4 mr-1.5 text-white" }} {{ .State }}
opened by {{ $owner := didOrHandle .Issue.OwnerDid .IssueOwnerHandle }} {{ $owner }}
{{ if .Issue.Body }}
{{ .Issue.Body | markdown }}
{{ end }}
{{ end }} {{ define "repoAfter" }}
{{ range $index, $comment := .Comments }}
{{ if gt $index 0 }}
{{ end }} {{ template "repo/issues/fragments/issueComment" (dict "RepoInfo" $.RepoInfo "LoggedInUser" $.LoggedInUser "DidHandleMap" $.DidHandleMap "Issue" $.Issue "Comment" .)}}
{{ end }}
{{ block "newComment" . }} {{ end }} {{ end }} {{ define "newComment" }} {{ if .LoggedInUser }}
{{ didOrHandle .LoggedInUser.Did .LoggedInUser.Handle }}
{{ $isIssueAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Issue.OwnerDid) }} {{ $isRepoCollaborator := .RepoInfo.Roles.IsCollaborator }} {{ if and (or $isIssueAuthor $isRepoCollaborator) (eq .State "open") }}
{{ else if and (or $isIssueAuthor $isRepoCollaborator) (eq .State "closed") }} {{ end }}
{{ else }}
login to join the discussion
{{ end }} {{ end }}