|
460 | 460 | <div class="timeline-item event">
|
461 | 461 | {{range $filename, $lines := .Review.CodeComments}}
|
462 | 462 | {{range $line, $comms := $lines}}
|
463 |
| - <div class="ui segments"> |
464 |
| - <div class="ui segment collapsible-comment-box gt-py-3 gt-df gt-ac gt-sb"> |
465 |
| - {{$invalid := (index $comms 0).Invalidated}} |
466 |
| - {{$resolved := (index $comms 0).IsResolved}} |
467 |
| - {{$resolveDoer := (index $comms 0).ResolveDoer}} |
468 |
| - {{$isNotPending := (not (eq (index $comms 0).Review.Type 0))}} |
469 |
| - <div class="gt-df gt-ac"> |
470 |
| - <a href="{{(index $comms 0).CodeCommentLink ctx}}" class="file-comment gt-ml-3 gt-word-break">{{$filename}}</a> |
471 |
| - {{if $invalid}} |
472 |
| - <span class="ui label basic small gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}"> |
473 |
| - {{ctx.Locale.Tr "repo.issues.review.outdated"}} |
474 |
| - </span> |
475 |
| - {{end}} |
476 |
| - </div> |
477 |
| - <div> |
478 |
| - {{if or $invalid $resolved}} |
479 |
| - <button id="show-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if not $resolved}}gt-hidden {{end}}ui compact labeled button show-outdated gt-df gt-ac"> |
480 |
| - {{svg "octicon-unfold" 16 "gt-mr-3"}} |
481 |
| - {{if $resolved}} |
482 |
| - {{ctx.Locale.Tr "repo.issues.review.show_resolved"}} |
483 |
| - {{else}} |
484 |
| - {{ctx.Locale.Tr "repo.issues.review.show_outdated"}} |
485 |
| - {{end}} |
486 |
| - </button> |
487 |
| - <button id="hide-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if $resolved}}gt-hidden {{end}}ui compact labeled button hide-outdated gt-df gt-ac"> |
488 |
| - {{svg "octicon-fold" 16 "gt-mr-3"}} |
489 |
| - {{if $resolved}} |
490 |
| - {{ctx.Locale.Tr "repo.issues.review.hide_resolved"}} |
491 |
| - {{else}} |
492 |
| - {{ctx.Locale.Tr "repo.issues.review.hide_outdated"}} |
493 |
| - {{end}} |
494 |
| - </button> |
495 |
| - {{end}} |
496 |
| - </div> |
497 |
| - </div> |
498 |
| - {{$diff := (CommentMustAsDiff ctx (index $comms 0))}} |
499 |
| - {{if $diff}} |
500 |
| - {{$file := (index $diff.Files 0)}} |
501 |
| - <div id="code-preview-{{(index $comms 0).ID}}" class="ui table segment{{if $resolved}} gt-hidden{{end}}"> |
502 |
| - <div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}}"> |
503 |
| - <div class="file-body file-code code-view code-diff code-diff-unified unicode-escaped"> |
504 |
| - <table> |
505 |
| - <tbody> |
506 |
| - {{template "repo/diff/section_unified" dict "file" $file "root" $}} |
507 |
| - </tbody> |
508 |
| - </table> |
509 |
| - </div> |
510 |
| - </div> |
511 |
| - </div> |
512 |
| - {{end}} |
513 |
| - <div id="code-comments-{{(index $comms 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} gt-hidden{{end}}"> |
514 |
| - <div class="ui comments gt-mb-0"> |
515 |
| - {{range $comms}} |
516 |
| - {{$createdSubStr:= TimeSinceUnix .CreatedUnix ctx.Locale}} |
517 |
| - <div class="comment code-comment gt-pb-4" id="{{.HashTag}}"> |
518 |
| - <div class="content"> |
519 |
| - <div class="header comment-header"> |
520 |
| - <div class="comment-header-left gt-df gt-ac"> |
521 |
| - {{if not .OriginalAuthor}} |
522 |
| - <a class="avatar"> |
523 |
| - {{ctx.AvatarUtils.Avatar .Poster 20}} |
524 |
| - </a> |
525 |
| - {{end}} |
526 |
| - <span class="text grey muted-links"> |
527 |
| - {{if .OriginalAuthor}} |
528 |
| - <span class="text black gt-font-semibold"> |
529 |
| - {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} |
530 |
| - {{.OriginalAuthor}} |
531 |
| - </span> |
532 |
| - <span class="text grey muted-links"> {{if $.Repository.OriginalURL}}</span> |
533 |
| - <span class="text migrate">({{ctx.Locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span> |
534 |
| - {{else}} |
535 |
| - {{template "shared/user/authorlink" .Poster}} |
536 |
| - {{end}} |
537 |
| - {{ctx.Locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdSubStr | Safe}} |
538 |
| - </span> |
539 |
| - </div> |
540 |
| - <div class="comment-header-right actions gt-df gt-ac"> |
541 |
| - {{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole}} |
542 |
| - {{if not $.Repository.IsArchived}} |
543 |
| - {{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}} |
544 |
| - {{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" . "delete" true "issue" true "diff" true "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} |
545 |
| - {{end}} |
546 |
| - </div> |
547 |
| - </div> |
548 |
| - <div class="text comment-content"> |
549 |
| - <div class="render-content markup" {{if or $.Permission.IsAdmin $.HasIssuesOrPullsWritePermission (and $.IsSigned (eq $.SignedUserID .PosterID))}}data-can-edit="true"{{end}}> |
550 |
| - {{if .RenderedContent}} |
551 |
| - {{.RenderedContent|Str2html}} |
552 |
| - {{else}} |
553 |
| - <span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span> |
554 |
| - {{end}} |
555 |
| - </div> |
556 |
| - <div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div> |
557 |
| - <div class="edit-content-zone gt-hidden" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div> |
558 |
| - </div> |
559 |
| - {{$reactions := .Reactions.GroupByType}} |
560 |
| - {{if $reactions}} |
561 |
| - {{template "repo/issue/view_content/reactions" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}} |
562 |
| - {{end}} |
563 |
| - </div> |
564 |
| - </div> |
565 |
| - {{end}} |
566 |
| - </div> |
567 |
| - <div class="code-comment-buttons gt-df gt-ac gt-fw gt-mt-3 gt-mb-2 gt-mx-3"> |
568 |
| - <div class="gt-f1"> |
569 |
| - {{if $resolved}} |
570 |
| - <div class="ui grey text"> |
571 |
| - {{svg "octicon-check" 16 "gt-mr-2"}} |
572 |
| - <b>{{$resolveDoer.Name}}</b> {{ctx.Locale.Tr "repo.issues.review.resolved_by"}} |
573 |
| - </div> |
574 |
| - {{end}} |
575 |
| - </div> |
576 |
| - <div class="code-comment-buttons-buttons"> |
577 |
| - {{if and $.CanMarkConversation $isNotPending}} |
578 |
| - <button class="ui tiny basic button resolve-conversation" data-origin="timeline" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index $comms 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation"> |
579 |
| - {{if $resolved}} |
580 |
| - {{ctx.Locale.Tr "repo.issues.review.un_resolve_conversation"}} |
581 |
| - {{else}} |
582 |
| - {{ctx.Locale.Tr "repo.issues.review.resolve_conversation"}} |
583 |
| - {{end}} |
584 |
| - </button> |
585 |
| - {{end}} |
586 |
| - {{if and $.SignedUserID (not $.Repository.IsArchived)}} |
587 |
| - <button class="comment-form-reply ui primary tiny labeled icon button gt-ml-2 gt-mr-0"> |
588 |
| - {{svg "octicon-reply" 16 "reply icon gt-mr-2"}}{{ctx.Locale.Tr "repo.diff.comment.reply"}} |
589 |
| - </button> |
590 |
| - {{end}} |
591 |
| - </div> |
592 |
| - </div> |
593 |
| - {{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index $comms 0).ReviewID "root" $ "comment" (index $comms 0)}} |
594 |
| - </div> |
595 |
| - </div> |
| 463 | + {{template "repo/issue/view_content/conversation" dict "." $ "comments" $comms}} |
596 | 464 | {{end}}
|
597 | 465 | {{end}}
|
598 | 466 | </div>
|
|
0 commit comments