|
371 | 371 | {{else if eq .Type 22}}
|
372 | 372 | <div class="timeline-item-group" id="{{.HashTag}}">
|
373 | 373 | <div class="timeline-item event">
|
| 374 | + {{$reviewType := -1}} |
| 375 | + {{if .Review}}{{$reviewType = .Review.Type}}{{end}} |
374 | 376 | {{if not .OriginalAuthor}}
|
375 | 377 | {{/* Some timeline avatars need a offset to correctly align with their speech
|
376 | 378 | bubble. The condition depends on review type and for positive reviews whether
|
377 | 379 | there is a comment element or not */}}
|
378 |
| - <a class="timeline-avatar{{if or (and (eq .Review.Type 1) (or .Content .Attachments)) (and (eq .Review.Type 2) (or .Content .Attachments)) (eq .Review.Type 3)}} timeline-avatar-offset{{end}}"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}> |
| 380 | + <a class="timeline-avatar{{if or (and (eq $reviewType 1) (or .Content .Attachments)) (and (eq $reviewType 2) (or .Content .Attachments)) (eq $reviewType 3)}} timeline-avatar-offset{{end}}"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}> |
379 | 381 | {{ctx.AvatarUtils.Avatar .Poster 40}}
|
380 | 382 | </a>
|
381 | 383 | {{end}}
|
382 |
| - <span class="badge{{if eq .Review.Type 1}} tw-bg-green tw-text-white{{else if eq .Review.Type 3}} tw-bg-red tw-text-white{{end}}">{{svg (printf "octicon-%s" .Review.Type.Icon)}}</span> |
| 384 | + <span class="badge{{if eq $reviewType 1}} tw-bg-green tw-text-white{{else if eq $reviewType 3}} tw-bg-red tw-text-white{{end}}"> |
| 385 | + {{if .Review}}{{svg (printf "octicon-%s" .Review.Type.Icon)}}{{end}} |
| 386 | + </span> |
383 | 387 | <span class="text grey muted-links">
|
384 | 388 | {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}}
|
385 |
| - {{if eq .Review.Type 1}} |
| 389 | + {{if eq $reviewType 1}} |
386 | 390 | {{ctx.Locale.Tr "repo.issues.review.approve" $createdStr}}
|
387 |
| - {{else if eq .Review.Type 2}} |
| 391 | + {{else if eq $reviewType 2}} |
388 | 392 | {{ctx.Locale.Tr "repo.issues.review.comment" $createdStr}}
|
389 |
| - {{else if eq .Review.Type 3}} |
| 393 | + {{else if eq $reviewType 3}} |
390 | 394 | {{ctx.Locale.Tr "repo.issues.review.reject" $createdStr}}
|
391 | 395 | {{else}}
|
392 | 396 | {{ctx.Locale.Tr "repo.issues.review.comment" $createdStr}}
|
393 | 397 | {{end}}
|
394 |
| - {{if .Review.Dismissed}} |
| 398 | + {{if and .Review .Review.Dismissed}} |
395 | 399 | <div class="ui small label">{{ctx.Locale.Tr "repo.issues.review.dismissed_label"}}</div>
|
396 | 400 | {{end}}
|
397 | 401 | </span>
|
|
451 | 455 | </div>
|
452 | 456 | {{end}}
|
453 | 457 |
|
454 |
| - {{if .Review.CodeComments}} |
| 458 | + {{if and .Review .Review.CodeComments}} |
455 | 459 | <div class="timeline-item event">
|
456 | 460 | {{range $filename, $lines := .Review.CodeComments}}
|
457 | 461 | {{range $line, $comms := $lines}}
|
|
606 | 610 | <span class="badge grey">{{svg "octicon-x" 16}}</span>
|
607 | 611 | <span class="text grey muted-links">
|
608 | 612 | {{template "shared/user/authorlink" .Poster}}
|
609 |
| - {{$reviewerName := ""}} |
610 |
| - {{if eq .Review.OriginalAuthor ""}} |
611 |
| - {{$reviewerName = .Review.Reviewer.Name}} |
612 |
| - {{else}} |
613 |
| - {{$reviewerName = .Review.OriginalAuthor}} |
| 613 | + {{if .Review}} |
| 614 | + {{$reviewerName := ""}} |
| 615 | + {{if eq .Review.OriginalAuthor ""}} |
| 616 | + {{$reviewerName = .Review.Reviewer.Name}} |
| 617 | + {{else}} |
| 618 | + {{$reviewerName = .Review.OriginalAuthor}} |
| 619 | + {{end}} |
| 620 | + {{ctx.Locale.Tr "repo.issues.review.dismissed" $reviewerName $createdStr}} |
614 | 621 | {{end}}
|
615 |
| - {{ctx.Locale.Tr "repo.issues.review.dismissed" $reviewerName $createdStr}} |
616 | 622 | </span>
|
617 | 623 | </div>
|
618 | 624 | {{if .Content}}
|
|
0 commit comments