A vibe coded tangled fork which supports pijul.
at 65691932e7d2bb4046599dac9915365b352d37e3 57 lines 2.1 kB view raw
1{{ define "repo/issues/fragments/issueCommentHeader" }} 2 <div class="flex flex-wrap items-center gap-2 text-sm text-gray-500 dark:text-gray-400 "> 3 {{ resolve .Comment.Did }} 4 {{ template "hats" $ }} 5 <span class="before:content-['·']"></span> 6 {{ template "timestamp" . }} 7 {{ $isCommentOwner := and .LoggedInUser (eq .LoggedInUser.Did .Comment.Did) }} 8 {{ if and $isCommentOwner (not .Comment.Deleted) }} 9 {{ template "editIssueComment" . }} 10 {{ template "deleteIssueComment" . }} 11 {{ end }} 12 </div> 13{{ end }} 14 15{{ define "hats" }} 16 {{ $isIssueAuthor := eq .Comment.Did .Issue.Did }} 17 {{ if $isIssueAuthor }} 18 (author) 19 {{ end }} 20{{ end }} 21 22{{ define "timestamp" }} 23 <a href="#comment-{{ .Comment.Id }}" 24 class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-400 hover:underline no-underline" 25 id="comment-{{ .Comment.Id }}"> 26 {{ if .Comment.Deleted }} 27 {{ template "repo/fragments/shortTimeAgo" .Comment.Deleted }} 28 {{ else if .Comment.Edited }} 29 edited {{ template "repo/fragments/shortTimeAgo" .Comment.Edited }} 30 {{ else }} 31 {{ template "repo/fragments/shortTimeAgo" .Comment.Created }} 32 {{ end }} 33 </a> 34{{ end }} 35 36{{ define "editIssueComment" }} 37 <a 38 class="text-gray-500 dark:text-gray-400 flex gap-1 items-center group cursor-pointer" 39 hx-get="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment/{{ .Comment.Id }}/edit" 40 hx-swap="outerHTML" 41 hx-target="#comment-body-{{.Comment.Id}}"> 42 {{ i "pencil" "size-3" }} 43 </a> 44{{ end }} 45 46{{ define "deleteIssueComment" }} 47 <a 48 class="text-gray-500 dark:text-gray-400 flex gap-1 items-center group cursor-pointer" 49 hx-delete="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment/{{ .Comment.Id }}/" 50 hx-confirm="Are you sure you want to delete your comment?" 51 hx-swap="outerHTML" 52 hx-target="#comment-body-{{.Comment.Id}}" 53 > 54 {{ i "trash-2" "size-3" }} 55 {{ i "loader-circle" "size-3 animate-spin hidden group-[.htmx-request]:inline" }} 56 </a> 57{{ end }}