forked from tangled.org/core
Monorepo for Tangled

add confirm for comment deletion

Changed files
+3 -2
appview
pages
templates
fragments
repo
issues
+2 -1
appview/pages/templates/fragments/issueComment.html
··· 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" ··· 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 >
··· 28 {{ end }} 29 </a> 30 31 + {{ $isCommentOwner := and $.LoggedInUser (eq $.LoggedInUser.Did .OwnerDid) }} 32 {{ if and $isCommentOwner (not .Deleted) }} 33 <button 34 class="btn px-2 py-1 text-sm" ··· 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-confirm="Are you sure you want to delete your comment?" 45 hx-swap="outerHTML" 46 hx-target="#comment-container-{{.CommentId}}" 47 >
+1 -1
appview/pages/templates/repo/issues/issue.html
··· 107 </form> 108 </div> 109 {{ else }} 110 - <div class="bg-white rounded drop-shadow-sm px-6 py-4 mt-8"> 111 <div class="absolute left-8 -top-8 w-px h-8 bg-gray-300 dark:bg-gray-700" ></div> 112 <a href="/login" class="underline">login</a> to join the discussion 113 </div>
··· 107 </form> 108 </div> 109 {{ else }} 110 + <div class="bg-white dark:bg-gray-800 dark:text-gray-400 rounded drop-shadow-sm px-6 py-4 mt-8"> 111 <div class="absolute left-8 -top-8 w-px h-8 bg-gray-300 dark:bg-gray-700" ></div> 112 <a href="/login" class="underline">login</a> to join the discussion 113 </div>