{{/* TODO: At the moment, two kinds of request handler call this template: * ExcerptBlob -> blob_excerpt.tmpl -> this * Other compare and diff pages -> ... -> {section_unified.tmpl|section_split.tmpl} -> this) The variables in "ctx.Data" are different in each case, making this template fragile, hard to read and maintain. */}} {{if len .comments}} {{$firstComment := index .comments 0 -}} {{$invalid := $firstComment.Invalidated -}} {{$resolved := $firstComment.IsResolved -}} {{$resolveDoer := $firstComment.ResolveDoer -}} {{$hasReview := and $firstComment.Review -}} {{$isReviewPending := and $hasReview (eq $firstComment.Review.Type 0) -}} {{$root := ctx.RootData -}} {{$repo := $root.Repository -}} {{$repoLink := $root.RepoLink -}} {{$editorconfig := $root.Editorconfig -}} {{$canWrite := or $root.Permission.IsAdmin $root.HasIssuesOrPullsWritePermission -}} {{$signedUserID := or $root.SignedUserID NIL -}} {{$canMarkAsResolved := and $root.CanMarkConversation $hasReview (not $isReviewPending)}} {{$canAddComment := and $root.SignedUserID (not $root.Repository.IsArchived)}}
{{$firstComment.TreePath}} {{if $invalid}} {{ctx.Locale.Tr "repo.issues.review.outdated"}} {{end}}
{{if or $invalid $resolved}} {{end}}
{{$diff := (CommentMustAsDiff ctx $firstComment)}} {{if $diff}} {{$file := (index $diff.Files 0)}}
{{template "repo/diff/section_unified" dict "file" $file}}
{{end}}
{{range $comment := .comments}} {{$createdSubStr:= DateUtils.TimeSince $comment.CreatedUnix}}
{{if not $comment.OriginalAuthor}} {{ctx.AvatarUtils.Avatar $comment.Poster 20}} {{end}} {{if $comment.OriginalAuthor}} {{svg (MigrationIcon $repo.GetOriginalURLHostname)}} {{$comment.OriginalAuthor}} {{if $repo.OriginalURL}} ({{ctx.Locale.Tr "repo.migrated_from" $repo.OriginalURL $repo.GetOriginalURLHostname}}) {{end}} {{else}} {{template "shared/user/authorlink" $comment.Poster}} {{end}} {{ctx.Locale.Tr "repo.issues.commented_at" $comment.HashTag $createdSubStr}}
{{template "repo/issue/view_content/show_role" dict "ShowRole" $comment.ShowRole}} {{if not $repo.IsArchived}} {{template "repo/issue/view_content/context_menu" dict "ConvContentType" "issue_comment" "ConvContentItem" $comment}} {{end}}
{{$doerIsPoster := eq $signedUserID $comment.PosterID}}
{{if $comment.RenderedContent}} {{$comment.RenderedContent}} {{else}} {{ctx.Locale.Tr "repo.issues.no_content"}} {{end}}
{{$comment.Content}}
{{if $comment.Attachments}} {{template "repo/issue/view_content/attachments" dict "Attachments" $comment.Attachments "RenderedContent" $comment.RenderedContent}} {{end}}
{{template "shared/reactions" dict "AllowedReactions" $root.AllowedIssueReactions "ActionURL" (printf "%s/comments/%d/reactions" $repoLink $comment.ID) "Reactions" $comment.Reactions.GroupByType }}
{{end}}
{{if $resolved}}
{{svg "octicon-check" 16 "tw-mr-1"}} {{$resolveDoer.Name}} {{ctx.Locale.Tr "repo.issues.review.resolved_by"}}
{{end}}
{{if $canMarkAsResolved}} {{end}} {{if $canAddComment}} {{end}}
{{template "repo/diff/comment_form" dict "ReplyReviewComment" $firstComment}}
{{else}} {{template "repo/diff/conversation_outdated"}} {{end}}