This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

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