This repository has no description
1{{ define "repo/pulls/fragments/pullNewComment" }}
2<div class="w-full flex flex-col gap-2">
3 {{ template "user/fragments/picHandleLink" .LoggedInUser.Did }}
4 <form
5 class="w-full flex flex-wrap gap-2 group"
6 hx-post="/comment"
7 hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:find textarea"
8 hx-target="#pull-comments-{{ .RoundNumber }}"
9 hx-swap="beforeend"
10 hx-disabled-elt="find button[type='submit']"
11 hx-on::before-request="this.querySelector('.error').innerHTML = ''"
12 hx-on::after-request="if(event.detail.successful) htmx.ajax('GET', '/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/actions', {target: '#actions-{{ .RoundNumber }}', swap: 'outerHTML'})"
13 >
14 <input name="subject-uri" type="hidden" value="{{ .Pull.AtUri }}">
15 <input name="pull-round-idx" type="hidden" value="{{ .RoundNumber }}">
16 <textarea
17 id="comment-textarea"
18 name="body"
19 class="w-full p-2 rounded border"
20 rows=8
21 placeholder="Add to the discussion..."></textarea
22 >
23 {{ template "replyActions" . }}
24 <div id="comment-error-{{ .RoundNumber }}" class="error"></div>
25 </form>
26</div>
27{{ end }}
28
29{{ define "replyActions" }}
30 <div class="flex flex-wrap items-stretch justify-end gap-2 text-gray-500 dark:text-gray-400 text-sm w-full">
31 {{ template "cancel" . }}
32 {{ template "reply" . }}
33 </div>
34{{ end }}
35
36{{ define "cancel" }}
37 <button
38 type="button"
39 class="btn-flat text-red-500 dark:text-red-400 flex gap-2 items-center group"
40 hx-get="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/actions"
41 hx-swap="outerHTML"
42 hx-target="#actions-{{.RoundNumber}}"
43 >
44 {{ i "x" "w-4 h-4" }}
45 <span>Cancel</span>
46 </button>
47{{ end }}
48
49{{ define "reply" }}
50 <button
51 type="submit"
52 class="btn-create-flat flex items-center gap-2">
53 {{ i "reply" "w-4 h-4 inline group-[.htmx-request]:hidden" }}
54 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }}
55 Reply
56 </button>
57{{ end }}