forked from tangled.org/core
this repo has no description

add confirm for comment deletion

Changed files
+3 -2
appview
pages
templates
fragments
repo
issues
+2 -1
appview/pages/templates/fragments/issueComment.html
···
{{ end }}
</a>
-
{{ $isCommentOwner := eq $.LoggedInUser.Did .OwnerDid }}
+
{{ $isCommentOwner := and $.LoggedInUser (eq $.LoggedInUser.Did .OwnerDid) }}
{{ if and $isCommentOwner (not .Deleted) }}
<button
class="btn px-2 py-1 text-sm"
···
<button
class="btn px-2 py-1 text-sm text-red-500"
hx-delete="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/"
+
hx-confirm="Are you sure you want to delete your comment?"
hx-swap="outerHTML"
hx-target="#comment-container-{{.CommentId}}"
>
+1 -1
appview/pages/templates/repo/issues/issue.html
···
</form>
</div>
{{ else }}
-
<div class="bg-white rounded drop-shadow-sm px-6 py-4 mt-8">
+
<div class="bg-white dark:bg-gray-800 dark:text-gray-400 rounded drop-shadow-sm px-6 py-4 mt-8">
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300 dark:bg-gray-700" ></div>
<a href="/login" class="underline">login</a> to join the discussion
</div>