forked from tangled.org/core
Monorepo for Tangled — https://tangled.org
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 group" 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 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 33 </button> 34 <button 35 class="btn px-2 py-1 flex items-center gap-2 text-sm" 36 hx-get="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/" 37 hx-target="#comment-container-{{ .CommentId }}" 38 hx-swap="outerHTML"> 39 {{ i "x" "w-4 h-4" }} 40 </button> 41 <span id="comment-{{.CommentId}}-status"></span> 42 </div> 43 44 <div> 45 <textarea 46 id="edit-textarea-{{ .CommentId }}" 47 name="body" 48 class="w-full p-2 border rounded min-h-[100px]">{{ .Body }}</textarea> 49 </div> 50 </div> 51 {{ end }} 52{{ end }} 53