Monorepo for Tangled
at 9259beb17e5eb25f45d05c4d541415f1b6639829 43 lines 1.4 kB view raw
1{{ define "repo/issues/fragments/editIssueComment" }} 2 <div id="comment-body-{{.Comment.Id}}" class="pt-2"> 3 <textarea 4 id="edit-textarea-{{ .Comment.Id }}" 5 name="body" 6 class="w-full p-2 rounded border border-gray-200 dark:border-gray-700" 7 rows="5" 8 autofocus>{{ .Comment.Body }}</textarea> 9 10 {{ template "editActions" $ }} 11 </div> 12{{ end }} 13 14{{ define "editActions" }} 15 <div class="flex flex-wrap items-center justify-end gap-2 text-gray-500 dark:text-gray-400 text-sm pt-2"> 16 {{ template "cancel" . }} 17 {{ template "save" . }} 18 </div> 19{{ end }} 20 21{{ define "save" }} 22 <button 23 class="btn-create py-0 flex gap-1 items-center group text-sm" 24 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment/{{ .Comment.Id }}/edit" 25 hx-include="#edit-textarea-{{ .Comment.Id }}" 26 hx-target="#comment-body-{{ .Comment.Id }}" 27 hx-swap="outerHTML"> 28 {{ i "check" "size-4" }} 29 save 30 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 31 </button> 32{{ end }} 33 34{{ define "cancel" }} 35 <button 36 class="btn py-0 text-red-500 dark:text-red-400 flex gap-1 items-center group" 37 hx-get="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment/{{ .Comment.Id }}/" 38 hx-target="#comment-body-{{ .Comment.Id }}" 39 hx-swap="outerHTML"> 40 {{ i "x" "size-4" }} 41 cancel 42 </button> 43{{ end }}