This repository has no description
1{{ define "title" }}
2 {{ .Pull.Title }} · Pull #{{ .Pull.PullId }} · {{ .RepoInfo.FullName }} · Tangled
3{{ end }}
4
5{{ define "extrameta" }}
6 {{ template "repo/pulls/fragments/og" (dict "RepoInfo" .RepoInfo "Pull" .Pull) }}
7{{ end }}
8
9{{ define "mainLayout" }}
10 <div class="px-1 flex-grow flex flex-col gap-4">
11 <div class="max-w-full md:max-w-screen-lg mx-auto">
12 {{ block "contentLayout" . }}
13 {{ block "content" . }}{{ end }}
14 {{ end }}
15 </div>
16 {{ block "contentAfterLayout" . }}
17 <main>
18 {{ block "contentAfter" . }}{{ end }}
19 </main>
20 {{ end }}
21 </div>
22 <script>
23 (function() {
24 const details = document.getElementById('bottomSheet');
25 const backdrop = document.getElementById('bottomSheetBackdrop');
26 const isDesktop = () => window.matchMedia('(min-width: 1024px)').matches;
27
28 // function to update backdrop
29 const updateBackdrop = () => {
30 if (backdrop) {
31 if (details.open && !isDesktop()) {
32 backdrop.classList.remove('opacity-0', 'pointer-events-none');
33 backdrop.classList.add('opacity-100', 'pointer-events-auto');
34 document.body.style.overflow = 'hidden';
35 } else {
36 backdrop.classList.remove('opacity-100', 'pointer-events-auto');
37 backdrop.classList.add('opacity-0', 'pointer-events-none');
38 document.body.style.overflow = '';
39 }
40 }
41 };
42
43 // close on mobile initially
44 if (!isDesktop()) {
45 details.open = false;
46 }
47 updateBackdrop(); // initialize backdrop
48
49 // prevent closing on desktop
50 details.addEventListener('toggle', function(e) {
51 if (isDesktop() && !this.open) {
52 this.open = true;
53 }
54 updateBackdrop();
55 });
56
57 const mediaQuery = window.matchMedia('(min-width: 1024px)');
58 mediaQuery.addEventListener('change', function(e) {
59 if (e.matches) {
60 // switched to desktop - keep open
61 details.open = true;
62 } else {
63 // switched to mobile - close
64 details.open = false;
65 }
66 updateBackdrop();
67 });
68
69 // close when clicking backdrop
70 if (backdrop) {
71 backdrop.addEventListener('click', () => {
72 if (!isDesktop()) {
73 details.open = false;
74 }
75 });
76 }
77 })();
78 </script>
79 <script>
80 (function() {
81 const isPermalink = (id) => id.startsWith('comment-') || id.startsWith('round-');
82
83 const reveal = () => {
84 const raw = window.location.hash.slice(1);
85 if (!raw) return;
86 let id;
87 try { id = decodeURIComponent(raw); } catch (e) { return; }
88 if (!isPermalink(id)) return;
89 const target = document.getElementById(id);
90 if (!target) return;
91
92 for (let el = target.parentElement; el; el = el.parentElement) {
93 if (el.tagName === 'DETAILS') el.open = true;
94 }
95
96 requestAnimationFrame(() => requestAnimationFrame(() => {
97 target.scrollIntoView({ block: 'center' });
98 const card = target.closest('.group\\/comment') || target;
99 card.classList.add('comment-hl');
100 }));
101 };
102
103 if (document.readyState === 'loading') {
104 document.addEventListener('DOMContentLoaded', reveal);
105 } else {
106 reveal();
107 }
108 window.addEventListener('hashchange', reveal);
109 })();
110 </script>
111{{ end }}
112
113{{ define "repoContentLayout" }}
114 <div class="grid grid-cols-1 lg:grid-cols-10 gap-4 w-full">
115 <div class="col-span-1 lg:col-span-8 flex flex-col gap-4">
116 <section class="bg-white dark:bg-gray-800 p-6 rounded relative w-full mx-auto dark:text-white h-full flex-shrink">
117 {{ block "repoContent" . }}{{ end }}
118 </section>
119 {{ template "repo/pulls/fragments/pullVouchNudge" . }}
120 </div>
121 <div class="flex flex-col gap-6 col-span-1 lg:col-span-2">
122 {{ template "repo/fragments/labelPanel"
123 (dict "RepoInfo" $.RepoInfo
124 "Defs" $.LabelDefs
125 "Subject" $.Pull.AtUri
126 "State" $.Pull.Labels) }}
127 {{ template "repo/fragments/participants" $.Pull.Participants }}
128 {{ if $.LoggedInUser }}
129 {{ template "repo/pulls/fragments/subscribeButton"
130 (dict "RepoInfo" $.RepoInfo
131 "PullId" $.Pull.PullId
132 "IsSubscribed" $.IsSubscribed) }}
133 {{ end }}
134 {{ template "repo/fragments/backlinks"
135 (dict "RepoInfo" $.RepoInfo
136 "Backlinks" $.Backlinks) }}
137 {{ template "repo/fragments/externalLinkPanel" $.Pull.AtUri }}
138 </div>
139 </div>
140{{ end }}
141
142{{ define "contentAfter" }}
143 <input type="hidden" id="round-link-base" value="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .ActiveRound }}" />
144 {{ if .IsInterdiff }}
145 <input type="hidden" id="is-interdiff" value="1" />
146 {{ end }}
147 {{ template "repo/fragments/diff" (list .Diff .DiffOpts $) }}
148{{ end }}
149
150{{ define "repoContent" }}
151 {{ template "repo/pulls/fragments/pullHeader" . }}
152 {{ if (gt (len .Stack) 1) }}
153 <div class="mt-8">
154 {{ template "repo/pulls/fragments/pullStack" . }}
155 </div>
156 {{ end }}
157{{ end }}
158
159{{ define "resize-grip" }}
160 {{ $id := index . 0 }}
161 {{ $target := index . 1 }}
162 {{ $direction := index . 2 }}
163 <div id="{{ $id }}"
164 data-resizer="vertical"
165 data-target="{{ $target }}"
166 data-direction="{{ $direction }}"
167 class="resizer-vertical hidden lg:flex w-4 sticky top-12 max-h-screen flex-col items-center justify-center group">
168 <div class="w-1 h-16 group-hover:h-24 group-[.resizing]:h-24 transition-all rounded-full bg-gray-400 dark:bg-gray-500 group-hover:bg-gray-500 group-hover:dark:bg-gray-400"></div>
169 </div>
170{{ end }}
171
172{{ define "diffLayout" }}
173 {{ $diff := index . 0 }}
174 {{ $opts := index . 1 }}
175 {{ $root := index . 2 }}
176
177 <div class="flex col-span-full">
178 <!-- left panel -->
179 <div id="files" class="w-0 hidden lg:block overflow-hidden sticky top-12 max-h-screen overflow-y-auto pb-12">
180 <section class="overflow-x-auto text-sm px-6 py-2 border-b border-x border-gray-200 dark:border-gray-700 w-full mx-auto min-h-full rounded-b rounded-t-none bg-white dark:bg-gray-800 shadow-sm">
181 {{ template "repo/fragments/fileTree" $diff.FileTree }}
182 </section>
183 </div>
184
185 {{ template "resize-grip" (list "resize-files" "files" "before") }}
186
187 <!-- main content -->
188 <div id="diff-files" class="flex-1 min-w-0 sticky top-12 pb-12">
189 {{ template "diffFiles" (list $diff $opts) }}
190 </div>
191
192 {{ template "resize-grip" (list "resize-subs" "subs" "after") }}
193
194 <!-- right panel -->
195 {{ template "subsPanel" $ }}
196 </div>
197{{ end }}
198
199{{ define "subsPanel" }}
200 {{ $root := index . 2 }}
201 {{ $pull := $root.Pull }}
202 {{ $bgColor := "bg-gray-600 dark:bg-gray-700" }}
203
204 {{ if $pull.State.IsOpen }}
205 {{ $bgColor = "bg-green-600 dark:bg-green-700" }}
206 {{ else if $pull.State.IsMerged }}
207 {{ $bgColor = "bg-purple-600 dark:bg-purple-700" }}
208 {{ else if $pull.State.IsAbandoned }}
209 {{ $bgColor = "bg-red-600 dark:bg-red-700" }}
210 {{ end }}
211
212 <!-- backdrop overlay - only visible on mobile when open -->
213 <div id="bottomSheetBackdrop" class="fixed inset-0 bg-black/50 lg:hidden opacity-0 pointer-events-none transition-opacity duration-300 z-20"></div>
214 <!-- right panel - bottom sheet on mobile, side panel on desktop -->
215 <div id="subs" class="fixed bottom-0 left-0 right-0 z-30 w-full lg:static lg:z-auto lg:max-h-screen lg:sticky lg:top-12 overflow-hidden">
216 <details open id="bottomSheet" class="rounded-t-2xl lg:rounded-t shadow-lg lg:shadow-none group/panel">
217 <summary class="
218 flex gap-4 items-center justify-between
219 rounded-t-2xl lg:rounded-t cursor-pointer list-none p-4 lg:h-12
220 text-white lg:text-black lg:dark:text-white
221 {{ $bgColor }}
222 lg:bg-white lg:dark:bg-gray-800
223 shadow-sm border-t lg:border-x border-gray-200 dark:border-gray-700
224 lg:pointer-events-none
225 ">
226 <h2 class="">History</h2>
227 <span class="pointer-events-auto cursor-text">
228 {{ template "subsPanelSummary" $ }}
229 </span>
230 </summary>
231 <div class="max-h-[85vh] lg:max-h-[calc(100vh-3rem-3rem)] w-full flex flex-col-reverse gap-4 overflow-y-auto bg-slate-100 dark:bg-gray-900 lg:bg-transparent">
232 {{ template "submissions" $root }}
233 </div>
234 </details>
235 </div>
236{{ end }}
237
238{{ define "subsPanelSummary" }}
239 {{ $root := index . 2 }}
240 {{ $pull := $root.Pull }}
241 {{ $rounds := len $pull.Submissions }}
242 {{ $comments := $pull.TotalComments }}
243 <div class="flex items-center gap-2 text-sm">
244 <span>
245 {{ $rounds }} round{{ if ne $rounds 1 }}s{{ end }}
246 </span>
247 <span class="select-none before:content-['\00B7']"></span>
248 <span>
249 {{ $comments }} comment{{ if ne $comments 1 }}s{{ end }}
250 </span>
251
252 <span class="lg:hidden inline">
253 <span class="inline group-open:hidden">{{ i "chevron-up" "size-4" }}</span>
254 <span class="hidden group-open:inline">{{ i "chevron-down" "size-4" }}</span>
255 </span>
256 </div>
257{{ end }}
258
259{{ define "subsCheckbox" }}
260 <input type="checkbox" id="subsToggle" class="peer/subs hidden" checked/>
261{{ end }}
262
263{{ define "subsToggle" }}
264 <style>
265 #subsToggle:checked ~ div div#subs {
266 width: 100%;
267 margin-left: 0;
268 }
269 #subsToggle:checked ~ div label[for="subsToggle"] .show-toggle { display: none; }
270 #subsToggle:checked ~ div label[for="subsToggle"] .hide-toggle { display: flex; }
271 #subsToggle:not(:checked) ~ div label[for="subsToggle"] .hide-toggle { display: none; }
272
273 @media (min-width: 1024px) {
274 #subsToggle:checked ~ div div#subs {
275 width: 25vw;
276 max-width: 50vw;
277 }
278 #subsToggle:not(:checked) ~ div div#subs {
279 width: 0;
280 display: none;
281 margin-left: 0;
282 }
283 #subsToggle:not(:checked) ~ div div#resize-subs {
284 display: none;
285 }
286 }
287 </style>
288 <label title="Toggle review panel" for="subsToggle" class="hidden lg:flex items-center justify-end pointer-events-none">
289 <span class="show-toggle hit-area hit-area-4 hit-area-x-2 pointer-events-auto cursor-pointer">{{ i "message-square-more" "size-4" }}</span>
290 <span class="hide-toggle w-[25vw] justify-end"><span class="hit-area hit-area-4 hit-area-x-2 pointer-events-auto cursor-pointer">{{ i "message-square" "size-4" }}</span></span>
291 </label>
292{{ end }}
293
294
295{{ define "submissions" }}
296 {{ $lastIdx := sub (len .Pull.Submissions) 1 }}
297 {{ if not .LoggedInUser }}
298 {{ template "loginPrompt" $ }}
299 {{ end }}
300 {{ range $ridx, $item := reverse .Pull.Submissions }}
301 {{ $idx := sub $lastIdx $ridx }}
302 {{ template "submission" (list $item $idx $lastIdx $) }}
303 {{ end }}
304{{ end }}
305
306{{ define "submission" }}
307 {{ $item := index . 0 }}
308 {{ $idx := index . 1 }}
309 {{ $lastIdx := index . 2 }}
310 {{ $root := index . 3 }}
311 {{ $round := $item.RoundNumber }}
312 <div id="round-{{ $round }}" class="
313 w-full shadow-sm border overflow-clip
314
315 {{ if eq $round 0 }}rounded-b{{ else }}rounded{{ end }}
316 {{ if eq $round $root.ActiveRound }}
317 bg-blue-50/25 dark:bg-blue-900/10 border-blue-200 dark:border-blue-900
318 {{ else }}
319 bg-gray-50 dark:bg-gray-900 border-gray-200 dark:border-gray-700
320 {{ end }}
321 ">
322 {{ template "submissionHeader" $ }}
323 {{ template "submissionComments" $ }}
324 </div>
325{{ end }}
326
327{{ define "submissionHeader" }}
328 {{ $item := index . 0 }}
329 {{ $lastIdx := index . 2 }}
330 {{ $root := index . 3 }}
331 {{ $round := $item.RoundNumber }}
332 <div class="
333 {{ if ne $round 0 }}rounded-t{{ end }}
334 px-6 py-4 pr-2 pt-2
335 {{ if eq $round $root.ActiveRound }}
336 bg-blue-50 dark:bg-blue-950
337 {{ else }}
338 bg-white dark:bg-gray-800
339 {{ end }}
340
341 flex gap-2 sticky top-0 z-20">
342 <!-- left column: just profile picture -->
343 <div class="flex-shrink-0 pt-2">
344 {{ template "user/fragments/picLink" (list $root.Pull.OwnerDid "size-8" (index $root.VouchRelationships (did $root.Pull.OwnerDid))) }}
345 </div>
346 <!-- right column -->
347 <div class="flex-1 min-w-0 flex flex-col gap-1">
348 {{ template "submissionInfo" $ }}
349 {{ template "submissionCommits" $ }}
350 {{ template "submissionPipeline" $ }}
351 {{ if eq $lastIdx $round }}
352 <div id="mergecheck-banner">
353 {{ if $root.Pull.State.IsOpen }}
354 <div class="flex items-center gap-2 text-gray-500 dark:text-gray-400">
355 {{ i "loader-circle" "w-4 h-4 animate-spin" }}
356 <span>Checking mergeability…</span>
357 </div>
358 {{ end }}
359 </div>
360 {{ end }}
361 </div>
362 </div>
363{{ end }}
364
365{{ define "submissionInfo" }}
366 {{ $item := index . 0 }}
367 {{ $idx := index . 1 }}
368 {{ $root := index . 3 }}
369 {{ $round := $item.RoundNumber }}
370 <div class="flex gap-2 items-center justify-between mb-1">
371<span class="inline-flex items-center gap-2 text-sm
372 {{ if eq $round $root.ActiveRound }}
373 text-gray-600 dark:text-gray-300
374 {{ else }}
375 text-gray-500 dark:text-gray-400
376 {{ end }}
377 pt-2">
378 {{ $handle := resolve $root.Pull.OwnerDid }}
379 <a class="
380 {{ if eq $round $root.ActiveRound }}
381 text-gray-800 dark:text-gray-300 hover:text-gray-800 dark:hover:text-gray-200
382 {{ else }}
383 text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300
384 {{ end }}
385 " href="/{{ $handle }}">{{ $handle }}</a>
386 submitted
387 <span class="px-2 py-0.5 rounded font-mono text-xs border
388 {{ if eq $round $root.ActiveRound }}
389 text-blue-800 dark:text-white bg-blue-100 dark:bg-blue-600 border-blue-200 dark:border-blue-500
390 {{ else }}
391 text-black dark:text-white bg-gray-100 dark:bg-gray-700 border-gray-300 dark:border-gray-600
392 {{ end }}
393 ">
394 #{{ $round }}
395 </span>
396 <span class="select-none before:content-['\00B7']"></span>
397 <a class="
398 {{ if eq $round $root.ActiveRound }}
399 text-gray-600 dark:text-gray-300 hover:text-gray-600 dark:hover:text-gray-200
400 {{ else }}
401 text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300
402 {{ end }}
403 " href="#round-{{ $round }}">
404 {{ template "repo/fragments/shortTime" $item.Created }}
405 </a>
406 </span>
407 <div class="flex gap-2 items-center">
408 {{ if or $root.IsInterdiff (ne $root.ActiveRound $round) }}
409 <a class="btn-flat flex items-center gap-2 no-underline hover:no-underline text-sm"
410 href="/{{ $root.RepoInfo.FullName }}/pulls/{{ $root.Pull.PullId }}/round/{{ $round }}?{{ safeUrl $root.DiffOpts.Encode }}#round-{{ $round }}">
411 {{ i "diff" "w-4 h-4" }}
412 Diff
413 </a>
414 {{ end }}
415 {{ if and (ne $idx 0) (or (not $root.IsInterdiff) (ne $root.ActiveRound $round)) }}
416 <a class="btn-flat flex items-center gap-2 no-underline hover:no-underline text-sm"
417 href="/{{ $root.RepoInfo.FullName }}/pulls/{{ $root.Pull.PullId }}/round/{{ $round }}/interdiff?{{ safeUrl $root.DiffOpts.Encode }}">
418 {{ i "chevrons-left-right-ellipsis" "w-4 h-4 rotate-90" }}
419 Interdiff
420 </a>
421 {{ end }}
422 </div>
423 </div>
424{{ end }}
425
426{{ define "submissionCommits" }}
427 {{ $item := index . 0 }}
428 {{ $root := index . 3 }}
429 {{ $round := $item.RoundNumber }}
430 {{ $patches := $item.AsFormatPatch }}
431 {{ if $patches }}
432 <details class="group/commit">
433 <summary class="list-none cursor-pointer flex items-center gap-2">
434 <span>{{ i "git-commit-horizontal" "w-4 h-4" }}</span>
435 {{ len $patches }} commit{{ if ne (len $patches) 1 }}s{{ end }}
436 <div class="text-sm text-gray-500 dark:text-gray-400">
437 <span class="group-open/commit:hidden inline">Expand</span>
438 <span class="hidden group-open/commit:inline">Collapse</span>
439 </div>
440 </summary>
441 {{ range $patches }}
442 {{ template "submissionCommit" (list . $item $root) }}
443 {{ end }}
444 </details>
445 {{ end }}
446{{ end }}
447
448{{ define "submissionCommit" }}
449 {{ $patch := index . 0 }}
450 {{ $item := index . 1 }}
451 {{ $root := index . 2 }}
452 {{ $round := $item.RoundNumber }}
453 {{ with $patch }}
454 <div id="commit-{{.SHA}}" class="py-1 relative w-full md:max-w-3/5 md:w-fit flex flex-col text-gray-600 dark:text-gray-300">
455 <div class="flex items-baseline gap-2">
456 <div class="text-xs">
457 <!-- attempt to resolve $fullRepo: this is possible only on non-deleted forks and branches -->
458 {{ $fullRepo := "" }}
459 {{ if and $root.Pull.IsForkBased $root.Pull.PullSource.Repo }}
460 {{ $fullRepo = printf "%s/%s" (resolve $root.Pull.PullSource.Repo.Did) $root.Pull.PullSource.Repo.Slug }}
461 {{ else if $root.Pull.IsBranchBased }}
462 {{ $fullRepo = $root.RepoInfo.FullName }}
463 {{ end }}
464
465 <!-- if $fullRepo was resolved, link to it, otherwise just span without a link -->
466 {{ if $fullRepo }}
467 <a href="/{{ $fullRepo }}/commit/{{ .SHA }}" class="font-mono text-gray-600 dark:text-gray-300">{{ slice .SHA 0 8 }}</a>
468 {{ else }}
469 <span class="font-mono">{{ slice .SHA 0 8 }}</span>
470 {{ end }}
471 </div>
472
473 <div>
474 <span>{{ .Title | description }}</span>
475 {{ if gt (len .Body) 0 }}
476 <button
477 class="py-1/2 px-1 mx-2 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
478 hx-on:click="document.getElementById('body-{{$round}}-{{.SHA}}').classList.toggle('hidden')"
479 >
480 {{ i "ellipsis" "w-3 h-3" }}
481 </button>
482 {{ end }}
483 {{ if gt (len .Body) 0 }}
484 <p id="body-{{$round}}-{{.SHA}}" class="hidden mt-1 pb-2">{{ nl2br .Body }}</p>
485 {{ end }}
486 </div>
487 </div>
488 </div>
489 {{ end }}
490{{ end }}
491
492{{ define "mergeStatus" }}
493 {{ if .Pull.State.IsClosed }}
494 <div class="bg-gray-50 dark:bg-gray-700 border border-black dark:border-gray-500 rounded shadow-sm px-6 py-2 relative">
495 <div class="flex items-center gap-2 text-black dark:text-white">
496 {{ i "ban" "w-4 h-4" }}
497 <span class="font-medium">Closed without merging</span
498 >
499 </div>
500 </div>
501 {{ else if .Pull.State.IsMerged }}
502 <div class="bg-purple-50 dark:bg-purple-900 border border-purple-500 rounded shadow-sm px-6 py-2 relative">
503 <div class="flex items-center gap-2 text-purple-500 dark:text-purple-300">
504 {{ i "git-merge" "w-4 h-4" }}
505 <span class="font-medium">Pull request successfully merged</span
506 >
507 </div>
508 </div>
509 {{ else if .Pull.State.IsAbandoned }}
510 <div class="bg-red-50 dark:bg-red-900 border border-red-500 rounded shadow-sm px-6 py-2 relative">
511 <div class="flex items-center gap-2 text-red-500 dark:text-red-300">
512 {{ i "git-pull-request-closed" "w-4 h-4" }}
513 <span class="font-medium">This pull has been deleted (possibly by jj abandon or jj squash)</span>
514 </div>
515 </div>
516 {{ end }}
517{{ end }}
518
519{{ define "submissionPipeline" }}
520 {{ $item := index . 0 }}
521 {{ $root := index . 3 }}
522 {{ $pipeline := index $root.Pipelines $item.SourceRev }}
523 {{ if and $pipeline $pipeline.Statuses }}
524 {{ $id := $pipeline.Id }}
525 <details class="group/pipeline">
526 <summary class="cursor-pointer list-none flex items-center gap-2">
527 {{ template "repo/pipelines/fragments/pipelineSymbol" (dict "Pipeline" $pipeline "ShortSummary" false) }}
528 <div class="text-sm text-gray-500 dark:text-gray-400">
529 <span class="group-open/pipeline:hidden inline">Expand</span>
530 <span class="hidden group-open/pipeline:inline">Collapse</span>
531 </div>
532 </summary>
533 <div class="my-2 grid grid-cols-1 bg-white dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 divide-y divide-gray-200 dark:divide-gray-700">
534 {{ range $name, $all := $pipeline.Statuses }}
535 <a href="/{{ $root.RepoInfo.FullName }}/pipelines/{{ $id }}/workflow/{{ $name }}" class="no-underline hover:no-underline hover:bg-gray-100/25 hover:dark:bg-gray-700/25">
536 <div
537 class="flex gap-2 items-center justify-between p-2">
538 {{ $lastStatus := $all.Latest }}
539 {{ $kind := $lastStatus.Status.String }}
540
541 <div id="left" class="flex items-center gap-2 flex-shrink-0">
542 {{ template "repo/pipelines/fragments/workflowSymbol" $all }}
543 {{ $name }}
544 </div>
545 <div id="right" class="flex items-center gap-2 flex-shrink-0">
546 <span class="font-bold">{{ $kind }}</span>
547 {{ if .TimeTaken }}
548 {{ template "repo/fragments/duration" .TimeTaken }}
549 {{ else }}
550 {{ template "repo/fragments/shortTimeAgo" $lastStatus.Created }}
551 {{ end }}
552 </div>
553 </div>
554 </a>
555 {{ end }}
556 </div>
557 </details>
558 {{ end }}
559{{ end }}
560
561{{ define "submissionComments" }}
562 {{ $item := index . 0 }}
563 {{ $idx := index . 1 }}
564 {{ $lastIdx := index . 2 }}
565 {{ $root := index . 3 }}
566 {{ $round := $item.RoundNumber }}
567 {{ $c := len $item.Comments }}
568 <details class="relative ml-10 group/comments group/collapse" {{ if or (eq $c 0) (eq $root.ActiveRound $round) }}open{{ end }}>
569 <summary class="cursor-pointer list-none">
570 <div class="collapse-trigger hidden group-open/comments:block absolute -left-8 top-0 bottom-0 w-16 transition-colors flex items-center justify-center group/border z-4">
571 <div class="absolute left-1/2 -translate-x-1/2 top-0 bottom-0 w-0.5 group-open/comments:bg-gray-200 dark:group-open/comments:bg-gray-700 group-has-[.collapse-trigger:hover]/collapse:bg-gray-400 dark:group-has-[.collapse-trigger:hover]/collapse:bg-gray-500 transition-colors"> </div>
572 </div>
573 <div class="group-open/comments:hidden block relative group/summary py-4">
574 <div class="absolute -left-8 top-0 bottom-0 w-16 transition-colors flex items-center justify-center z-4">
575 <div class="absolute left-1/2 -translate-x-1/2 h-1/3 top-0 bottom-0 w-0.5 bg-gray-200 dark:bg-gray-700 group-hover/summary:bg-gray-400 dark:group-hover/summary:bg-gray-500 transition-colors"></div>
576 </div>
577 <span class="text-gray-500 dark:text-gray-400 text-sm group-hover/summary:text-gray-600 dark:group-hover/summary:text-gray-300 transition-colors flex items-center gap-2 -ml-2 relative">
578 {{ i "circle-plus" "size-4 z-5" }}
579 Expand {{ $c }} comment{{ if ne $c 1 }}s{{ end }}
580 </span>
581 </div>
582 </summary>
583 <div id="pull-comments-{{ $round }}">
584 {{ range $item.Comments }}
585 {{ template "fragments/comment/pullComment"
586 (dict "LoggedInUser" $root.LoggedInUser
587 "Reactions" (index (asReactionMapMap $root.Reactions) .FeedCommentAtUri)
588 "UserReacted" (index (asReactionStatusMapMap $root.UserReacted) .FeedCommentAtUri)
589 "Comment" .) }}
590 {{ end }}
591 </div>
592 {{ if gt $c 0}}
593 <button class="collapse-trigger flex items-center gap-2 -ml-2 relative cursor-pointer text-sm text-gray-500 dark:text-gray-400 group-has-[.collapse-trigger:hover]/collapse:text-gray-600 dark:group-has-[.collapse-trigger:hover]/collapse:text-gray-300 mt-4 pb-4 transition-colors" hx-on:click="this.closest('details').open = false">
594 <span class="bg-gray-50 dark:bg-slate-900 dark:rounded-full">{{ i "circle-chevron-up" "size-4 z-5" }}</span> Collapse comment{{ if ne $c 1 }}s{{ end }}
595 </button>
596 {{ end }}
597
598 <div class="relative -ml-10">
599 {{ if eq $lastIdx $item.RoundNumber }}
600 {{ block "mergeStatus" $root }} {{ end }}
601 <div id="pull-action-error" class="error empty:hidden"></div>
602 {{ end }}
603 </div>
604 <div class="relative -ml-10 bg-gray-50 dark:bg-gray-900">
605 {{ template "repo/pulls/fragments/pullActions"
606 (dict
607 "LoggedInUser" $root.LoggedInUser
608 "Pull" $root.Pull
609 "RepoInfo" $root.RepoInfo
610 "RoundNumber" $item.RoundNumber
611 "MergeCheck" $root.MergeCheck
612 "ResubmitCheck" $root.ResubmitCheck
613 "BranchDeleteStatus" $root.BranchDeleteStatus
614 "Stack" $root.Stack
615 "Loading" (eq $lastIdx $item.RoundNumber)) }}
616 </div>
617 </details>
618{{ end }}
619
620{{ define "loginPrompt" }}
621 <div class="bg-amber-50 dark:bg-amber-900 border border-amber-500 rounded shadow-sm p-2 relative flex gap-2 items-center">
622 <a href="/signup" class="btn-create py-0 hover:no-underline hover:text-white flex items-center gap-2">
623 Sign up
624 </a>
625 <span class="text-gray-500 dark:text-gray-400">or</span>
626 <a href="/login" class="underline">Login</a>
627 to add to the discussion
628 </div>
629{{ end }}