···
48
+
{{ if gt (len .Comments) 0 }}
<section id="comments" class="mt-8 space-y-4 relative">
{{ range $index, $comment := .Comments }}
···
class="rounded bg-white px-6 py-4 relative"
56
-
class="absolute left-8 -top-8 w-px h-8 bg-gray-300"
56
+
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300" ></div>
60
-
class="absolute left-8 -top-4 w-px h-4 bg-gray-300"
58
+
<div class="absolute left-8 -top-4 w-px h-4 bg-gray-300" ></div>
<div class="flex items-center gap-2 mb-2 text-gray-500">
{{ $owner := index $.DidHandleMap .OwnerDid }}
···
89
-
{{ if .LoggedInUser }}
91
-
hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment"
96
-
class="w-full p-2 rounded border border-gray-200"
97
-
placeholder="Add to the discussion..."
99
-
<button type="submit" class="btn mt-2">comment</button>
100
-
<div id="issue-comment"></div>
103
-
<div class="w-full rounded p-6 drop-shadow-sm bg-white">
104
-
<a href="/login" class="underline">login</a> to join the discussion
87
+
{{ block "newComment" . }} {{ end }}
{{ $isIssueAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Issue.OwnerDid) }}
{{ $isRepoCollaborator := .RepoInfo.Roles.IsCollaborator }}
{{ if or $isIssueAuthor $isRepoCollaborator }}
···
117
+
{{ define "newComment" }}
118
+
{{ if .LoggedInUser }}
119
+
<div class="bg-white rounded drop-shadow-sm py-4 px-6 relative w-full flex flex-col gap-2 mt-8">
120
+
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300" ></div>
121
+
<div class="text-sm text-gray-500">
122
+
{{ didOrHandle .LoggedInUser.Did .LoggedInUser.Handle }}
124
+
<form hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment">
127
+
class="w-full p-2 rounded border border-gray-200"
128
+
placeholder="Add to the discussion..."
130
+
<button type="submit" class="btn mt-2">comment</button>
131
+
<div id="issue-comment"></div>
135
+
<div class="bg-white rounded drop-shadow-sm px-6 py-4 mt-8">
136
+
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300" ></div>
137
+
<a href="/login" class="underline">login</a> to join the discussion