1{{ define "repo/issues/fragments/editIssueComment" }}
2 {{ with .Comment }}
3 <div id="comment-container-{{.CommentId}}">
4 <div class="flex items-center gap-2 mb-2 text-gray-500 text-sm">
5 {{ $owner := didOrHandle $.LoggedInUser.Did $.LoggedInUser.Handle }}
6 <a href="/{{ $owner }}" class="no-underline hover:underline">{{ $owner }}</a>
7
8 <!-- show user "hats" -->
9 {{ $isIssueAuthor := eq .OwnerDid $.Issue.OwnerDid }}
10 {{ if $isIssueAuthor }}
11 <span class="before:content-['·']"></span>
12 <span class="rounded bg-gray-100 text-black font-mono px-2 mx-1/2 inline-flex items-center">
13 author
14 </span>
15 {{ end }}
16
17 <span class="before:content-['·']"></span>
18 <a
19 href="#{{ .CommentId }}"
20 class="text-gray-500 hover:text-gray-500 hover:underline no-underline"
21 id="{{ .CommentId }}">
22 {{ .Created | timeFmt }}
23 </a>
24
25 <button
26 class="btn px-2 py-1 flex items-center gap-2 text-sm"
27 hx-post="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/edit"
28 hx-include="#edit-textarea-{{ .CommentId }}"
29 hx-target="#comment-container-{{ .CommentId }}"
30 hx-swap="outerHTML">
31 {{ i "check" "w-4 h-4" }}
32 </button>
33 <button
34 class="btn px-2 py-1 flex items-center gap-2 text-sm"
35 hx-get="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/"
36 hx-target="#comment-container-{{ .CommentId }}"
37 hx-swap="outerHTML">
38 {{ i "x" "w-4 h-4" }}
39 </button>
40 <span id="comment-{{.CommentId}}-status"></span>
41 </div>
42
43 <div>
44 <textarea
45 id="edit-textarea-{{ .CommentId }}"
46 name="body"
47 class="w-full p-2 border rounded min-h-[100px]">{{ .Body }}</textarea>
48 </div>
49 </div>
50 {{ end }}
51{{ end }}
52