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 "repoContentLayout" }}
12 <div class="grid grid-cols-1 md:grid-cols-10 gap-4 w-full">
13 <div class="col-span-1 md:col-span-8">
14 <section class="bg-white dark:bg-gray-800 p-6 rounded relative w-full mx-auto dark:text-white">
15 {{ block "repoContent" . }}{{ end }}
16 </section>
17 {{ block "repoAfter" . }}{{ end }}
18 </div>
19 <div class="col-span-1 md:col-span-2 flex flex-col gap-6">
20 {{ template "issueLabels" . }}
21 {{ template "issueParticipants" . }}
22 </div>
23 </div>
24{{ end }}
25
26{{ define "repoContent" }}
27<section id="issue-{{ .Issue.IssueId }}">
28 {{ template "issueHeader" .Issue }}
29 {{ template "issueInfo" . }}
30 {{ if .Issue.Body }}
31 <article id="body" class="mt-4 prose dark:prose-invert">{{ .Issue.Body | markdown }}</article>
32 {{ end }}
33 <div class="flex flex-wrap gap-2 items-stretch mt-4">
34 {{ template "issueReactions" . }}
35 </div>
36</section>
37{{ end }}
38
39{{ define "issueHeader" }}
40 <header class="pb-2">
41 <h1 class="text-2xl">
42 {{ .Title | description }}
43 <span class="text-gray-500 dark:text-gray-400">#{{ .IssueId }}</span>
44 </h1>
45 </header>
46{{ end }}
47
48{{ define "issueInfo" }}
49 {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }}
50 {{ $icon := "ban" }}
51 {{ if eq .Issue.State "open" }}
52 {{ $bgColor = "bg-green-600 dark:bg-green-700" }}
53 {{ $icon = "circle-dot" }}
54 {{ end }}
55 <div class="inline-flex items-center gap-2">
56 <div id="state"
57 class="inline-flex items-center rounded px-3 py-1 {{ $bgColor }}">
58 {{ i $icon "w-4 h-4 mr-1.5 text-white" }}
59 <span class="text-white">{{ .Issue.State }}</span>
60 </div>
61 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1">
62 opened by
63 {{ template "user/fragments/picHandleLink" .Issue.Did }}
64 <span class="select-none before:content-['\00B7']"></span>
65 {{ if .Issue.Edited }}
66 edited {{ template "repo/fragments/time" .Issue.Edited }}
67 {{ else }}
68 {{ template "repo/fragments/time" .Issue.Created }}
69 {{ end }}
70 </span>
71
72 {{ if and .LoggedInUser (eq .LoggedInUser.Did .Issue.Did) }}
73 {{ template "issueActions" . }}
74 {{ end }}
75 </div>
76 <div id="issue-actions-error" class="error"></div>
77{{ end }}
78
79{{ define "issueActions" }}
80 {{ template "editIssue" . }}
81 {{ template "deleteIssue" . }}
82{{ end }}
83
84{{ define "editIssue" }}
85 <a
86 class="text-gray-500 dark:text-gray-400 flex gap-1 items-center group"
87 hx-get="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/edit"
88 hx-swap="innerHTML"
89 hx-target="#issue-{{.Issue.IssueId}}">
90 {{ i "pencil" "size-3" }}
91 </a>
92{{ end }}
93
94{{ define "deleteIssue" }}
95 <a
96 class="text-gray-500 dark:text-gray-400 flex gap-1 items-center group"
97 hx-delete="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/"
98 hx-confirm="Are you sure you want to delete your issue?"
99 hx-swap="none">
100 {{ i "trash-2" "size-3" }}
101 {{ i "loader-circle" "size-3 animate-spin hidden group-[.htmx-request]:inline" }}
102 </a>
103{{ end }}
104
105{{ define "issueReactions" }}
106 <div class="flex items-center gap-2">
107 {{ template "repo/fragments/reactionsPopUp" .OrderedReactionKinds }}
108 {{ range $kind := .OrderedReactionKinds }}
109 {{
110 template "repo/fragments/reaction"
111 (dict
112 "Kind" $kind
113 "Count" (index $.Reactions $kind)
114 "IsReacted" (index $.UserReacted $kind)
115 "ThreadAt" $.Issue.AtUri)
116 }}
117 {{ end }}
118 </div>
119{{ end }}
120
121{{ define "issueLabels" }}
122 <div>
123 <div class="text-sm py-1 flex items-center gap-2 font-bold text-gray-500 dark:text-gray-400 capitalize">
124 Labels
125 <button
126 class="inline-flex text-gray-500 dark:text-gray-400 {{ if not (or .RepoInfo.Roles.IsOwner .RepoInfo.Roles.IsCollaborator) }}hidden{{ end }}"
127 popovertarget="add-label-modal"
128 popovertargetaction="toggle">
129 {{ i "plus" "size-4" }}
130 </button>
131 </div>
132 <div class="flex gap-1 items-center flex-wrap">
133 {{ range $k, $valset := $.Issue.Labels.Inner }}
134 {{ $d := index $.LabelDefs $k }}
135 {{ range $v, $s := $valset }}
136 {{ template "labels/fragments/label" (dict "def" $d "val" $v) }}
137 {{ end }}
138 {{ else }}
139 <p class="text-gray-500 dark:text-gray-400 ">No labels yet.</p>
140 {{ end }}
141
142 <div
143 id="add-label-modal"
144 popover
145 class="bg-white w-full sm:w-[30rem] 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">
146 {{ template "repo/fragments/addLabelModal" (dict "root" $ "subject" $.Issue.AtUri.String "state" $.Issue.Labels) }}
147 </div>
148 </div>
149 </div>
150{{ end }}
151
152{{ define "issueParticipants" }}
153 {{ $all := .Issue.Participants }}
154 {{ $ps := take $all 5 }}
155 <div>
156 <div class="py-1 flex items-center text-sm">
157 <span class="font-bold text-gray-500 dark:text-gray-400 capitalize">Participants</span>
158 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 ml-1">{{ len $all }}</span>
159 </div>
160 <div class="flex items-center -space-x-2 mt-2">
161 {{ $c := "z-50 z-40 z-30 z-20 z-10" }}
162 {{ range $i, $p := $ps }}
163 <img
164 src="{{ tinyAvatar . }}"
165 alt=""
166 class="rounded-full h-8 w-8 mr-1 border-2 border-gray-300 dark:border-gray-700 z-{{sub 5 $i}}0"
167 />
168 {{ end }}
169
170 {{ if gt (len $all) 5 }}
171 <span class="pl-4 text-gray-500 dark:text-gray-400 text-sm">
172 +{{ sub (len $all) 5 }}
173 </span>
174 {{ end }}
175 </div>
176 </div>
177{{ end }}
178
179{{ define "repoAfter" }}
180 <div class="flex flex-col gap-4 mt-4">
181 {{
182 template "repo/issues/fragments/commentList"
183 (dict
184 "RepoInfo" $.RepoInfo
185 "LoggedInUser" $.LoggedInUser
186 "Issue" $.Issue
187 "CommentList" $.Issue.CommentList)
188 }}
189
190 {{ template "repo/issues/fragments/newComment" . }}
191 </div>
192{{ end }}