this repo has no description
1{{ define "title" }}{{ .Issue.Title }} · issue #{{ .Issue.IssueId }} · {{ .RepoInfo.FullName }}{{ end }}
2
3
4{{ define "extrameta" }}
5 {{ $title := printf "%s · issue #%d · %s" .Issue.Title .Issue.IssueId .RepoInfo.FullName }}
6 {{ $url := printf "https://tangled.org/%s/issues/%d" .RepoInfo.FullName .Issue.IssueId }}
7
8 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }}
9{{ end }}
10
11{{ define "repoContent" }}
12<section id="issue-{{ .Issue.IssueId }}">
13 {{ template "issueHeader" .Issue }}
14 {{ template "issueInfo" . }}
15 {{ if .Issue.Body }}
16 <article id="body" class="mt-4 prose dark:prose-invert">{{ .Issue.Body | markdown }}</article>
17 {{ end }}
18 <div class="flex flex-wrap gap-2 items-stretch">
19 {{ template "issueReactions" . }}
20 {{ template "issueLabels" . }}
21 </div>
22</section>
23{{ end }}
24
25{{ define "issueHeader" }}
26 <header class="pb-2">
27 <h1 class="text-2xl">
28 {{ .Title | description }}
29 <span class="text-gray-500 dark:text-gray-400">#{{ .IssueId }}</span>
30 </h1>
31 </header>
32{{ end }}
33
34{{ define "issueInfo" }}
35 {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }}
36 {{ $icon := "ban" }}
37 {{ if eq .Issue.State "open" }}
38 {{ $bgColor = "bg-green-600 dark:bg-green-700" }}
39 {{ $icon = "circle-dot" }}
40 {{ end }}
41 <div class="inline-flex items-center gap-2">
42 <div id="state"
43 class="inline-flex items-center rounded px-3 py-1 {{ $bgColor }}">
44 {{ i $icon "w-4 h-4 mr-1.5 text-white" }}
45 <span class="text-white">{{ .Issue.State }}</span>
46 </div>
47 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1">
48 opened by
49 {{ template "user/fragments/picHandleLink" .Issue.Did }}
50 <span class="select-none before:content-['\00B7']"></span>
51 {{ if .Issue.Edited }}
52 edited {{ template "repo/fragments/time" .Issue.Edited }}
53 {{ else }}
54 {{ template "repo/fragments/time" .Issue.Created }}
55 {{ end }}
56 </span>
57
58 {{ if and .LoggedInUser (eq .LoggedInUser.Did .Issue.Did) }}
59 {{ template "issueActions" . }}
60 {{ end }}
61 </div>
62 <div id="issue-actions-error" class="error"></div>
63{{ end }}
64
65{{ define "issueActions" }}
66 {{ template "editIssue" . }}
67 {{ template "deleteIssue" . }}
68{{ end }}
69
70{{ define "editIssue" }}
71 <a
72 class="text-gray-500 dark:text-gray-400 flex gap-1 items-center group"
73 hx-get="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/edit"
74 hx-swap="innerHTML"
75 hx-target="#issue-{{.Issue.IssueId}}">
76 {{ i "pencil" "size-3" }}
77 </a>
78{{ end }}
79
80{{ define "deleteIssue" }}
81 <a
82 class="text-gray-500 dark:text-gray-400 flex gap-1 items-center group"
83 hx-delete="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/"
84 hx-confirm="Are you sure you want to delete your issue?"
85 hx-swap="none">
86 {{ i "trash-2" "size-3" }}
87 {{ i "loader-circle" "size-3 animate-spin hidden group-[.htmx-request]:inline" }}
88 </a>
89{{ end }}
90
91{{ define "issueReactions" }}
92 <div class="flex items-center gap-2">
93 {{ template "repo/fragments/reactionsPopUp" .OrderedReactionKinds }}
94 {{ range $kind := .OrderedReactionKinds }}
95 {{
96 template "repo/fragments/reaction"
97 (dict
98 "Kind" $kind
99 "Count" (index $.Reactions $kind)
100 "IsReacted" (index $.UserReacted $kind)
101 "ThreadAt" $.Issue.AtUri)
102 }}
103 {{ end }}
104 </div>
105{{ end }}
106
107{{ define "issueLabels" }}
108 {{ range $k, $valset := $.Issue.Labels.Inner }}
109 {{ $d := index $.LabelDefs $k }}
110 {{ range $v, $s := $valset }}
111 {{ template "labels/fragments/label" (dict "def" $d "val" $v) }}
112 {{ end }}
113 {{ end }}
114
115 <button
116 class="btn text-gray-500 dark:text-gray-400"
117 popovertarget="add-label-modal"
118 {{ if not (or .RepoInfo.Roles.IsOwner .RepoInfo.Roles.IsCollaborator) }}disabled{{ end }}
119 popovertargetaction="toggle">
120 {{ i "plus" "size-4" }}
121 </button>
122 <div
123 id="add-label-modal"
124 popover
125 class="bg-white w-full sm:w-96 dark:bg-gray-800 p-6 rounded border border-gray-200 dark:border-gray-700 drop-shadow dark:text-white backdrop:bg-gray-400/50 dark:backdrop:bg-gray-800/50">
126 {{ template "repo/fragments/addLabelModal" (dict "root" $ "subject" $.Issue.AtUri.String "state" $.Issue.Labels) }}
127 </div>
128{{ end }}
129
130{{ define "repoAfter" }}
131 <div class="flex flex-col gap-4 mt-4">
132 {{
133 template "repo/issues/fragments/commentList"
134 (dict
135 "RepoInfo" $.RepoInfo
136 "LoggedInUser" $.LoggedInUser
137 "Issue" $.Issue
138 "CommentList" $.Issue.CommentList)
139 }}
140
141 {{ template "repo/issues/fragments/newComment" . }}
142 <div>
143{{ end }}