{{ define "title" }}{{ .Issue.Title }} · issue #{{ .Issue.IssueId }} · {{ .RepoInfo.FullName }}{{ end }} {{ define "extrameta" }} {{ $title := printf "%s · issue #%d · %s" .Issue.Title .Issue.IssueId .RepoInfo.FullName }} {{ $url := printf "https://tangled.org/%s/issues/%d" .RepoInfo.FullName .Issue.IssueId }} {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} {{ end }} {{ define "repoContentLayout" }}
{{ block "repoContent" . }}{{ end }}
{{ block "repoAfter" . }}{{ end }}
{{ template "issueLabels" . }} {{ template "issueParticipants" . }}
{{ end }} {{ define "repoContent" }}
{{ template "issueHeader" .Issue }} {{ template "issueInfo" . }} {{ if .Issue.Body }}
{{ .Issue.Body | markdown }}
{{ end }}
{{ template "issueReactions" . }} {{ template "issueLabels" . }}
{{ end }} {{ define "issueHeader" }}

{{ .Title | description }} #{{ .IssueId }}

{{ end }} {{ define "issueInfo" }} {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }} {{ $icon := "ban" }} {{ if eq .Issue.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" }} {{ .Issue.State }}
opened by {{ template "user/fragments/picHandleLink" .Issue.Did }} {{ if .Issue.Edited }} edited {{ template "repo/fragments/time" .Issue.Edited }} {{ else }} {{ template "repo/fragments/time" .Issue.Created }} {{ end }} {{ if and .LoggedInUser (eq .LoggedInUser.Did .Issue.Did) }} {{ template "issueActions" . }} {{ end }}
{{ end }} {{ define "issueActions" }} {{ template "editIssue" . }} {{ template "deleteIssue" . }} {{ end }} {{ define "editIssue" }} {{ i "pencil" "size-3" }} {{ end }} {{ define "deleteIssue" }} {{ i "trash-2" "size-3" }} {{ i "loader-circle" "size-3 animate-spin hidden group-[.htmx-request]:inline" }} {{ end }} {{ define "issueReactions" }}
{{ template "repo/fragments/reactionsPopUp" .OrderedReactionKinds }} {{ range $kind := .OrderedReactionKinds }} {{ template "repo/fragments/reaction" (dict "Kind" $kind "Count" (index $.Reactions $kind) "IsReacted" (index $.UserReacted $kind) "ThreadAt" $.Issue.AtUri) }} {{ end }}
{{ end }} {{ define "issueLabels" }} {{ range $k, $valset := $.Issue.Labels.Inner }} {{ $d := index $.LabelDefs $k }} {{ range $v, $s := $valset }} {{ template "labels/fragments/label" (dict "def" $d "val" $v) }} {{ end }} {{ end }}
{{ template "repo/fragments/addLabelModal" (dict "root" $ "subject" $.Issue.AtUri.String "state" $.Issue.Labels) }}
{{ end }} {{ define "repoAfter" }}
{{ template "repo/issues/fragments/commentList" (dict "RepoInfo" $.RepoInfo "LoggedInUser" $.LoggedInUser "Issue" $.Issue "CommentList" $.Issue.CommentList) }} {{ template "repo/issues/fragments/newComment" . }}
{{ end }}