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