this repo has no description
1{{ define "fragments/issueComment" }}
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 := index $.DidHandleMap .OwnerDid }}
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 dark:bg-gray-700 text-black dark:text-white 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 {{ if .Deleted }}
23 deleted {{ .Deleted | timeFmt }}
24 {{ else if .Edited }}
25 edited {{ .Edited | timeFmt }}
26 {{ else }}
27 {{ .Created | timeFmt }}
28 {{ end }}
29 </a>
30
31 {{ $isCommentOwner := eq $.LoggedInUser.Did .OwnerDid }}
32 {{ if and $isCommentOwner (not .Deleted) }}
33 <button
34 class="btn px-2 py-1 text-sm"
35 hx-get="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/edit"
36 hx-swap="outerHTML"
37 hx-target="#comment-container-{{.CommentId}}"
38 >
39 {{ i "pencil" "w-4 h-4" }}
40 </button>
41 <button
42 class="btn px-2 py-1 text-sm text-red-500"
43 hx-delete="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/"
44 hx-swap="outerHTML"
45 hx-target="#comment-container-{{.CommentId}}"
46 >
47 {{ i "trash-2" "w-4 h-4" }}
48 </button>
49 {{ end }}
50
51 </div>
52 {{ if not .Deleted }}
53 <div class="prose dark:prose-invert">
54 {{ .Body | markdown }}
55 </div>
56 {{ end }}
57 </div>
58 {{ end }}
59{{ end }}