{{if len .comments}} {{$root := ctx.RootData}} {{$comments := $.comments}} {{$firstComment := index $comments 0}} {{$resolved := $firstComment.IsResolved}} {{$invalid := $firstComment.Invalidated}} {{$resolveDoer := $firstComment.ResolveDoer}} {{$hasReview := and $firstComment.Review}} {{$isReviewPending := and $hasReview (eq $firstComment.Review.Type 0)}} {{$referenceUrl := printf "%s#%s" $root.Issue.Link $firstComment.HashTag}} {{$canAddComment := and $root.SignedUserID (not $root.Repository.IsArchived)}} {{$canMarkAsResolved := and $root.CanMarkConversation $hasReview (not $isReviewPending)}} {{$repoLink := $root.RepoLink}}