diff --git a/models/issues/review.go b/models/issues/review.go index fe123d7398..ed30bce149 100644 --- a/models/issues/review.go +++ b/models/issues/review.go @@ -189,6 +189,20 @@ func (r *Review) LoadAttributes(ctx context.Context) (err error) { return err } +func (r *Review) HTMLTypeColorName() string { + switch r.Type { + case ReviewTypeApprove: + return "green" + case ReviewTypeComment: + return "grey" + case ReviewTypeReject: + return "red" + case ReviewTypeRequest: + return "yellow" + } + return "grey" +} + // GetReviewByID returns the review by the given ID func GetReviewByID(ctx context.Context, id int64) (*Review, error) { review := new(Review) diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 13e3b53051..ab499f346a 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -372,7 +372,10 @@
{{$.locale.Tr "repo.issues.review.reviewers"}}
@@ -8,9 +8,12 @@{{range .ChangedProtectedFiles}} @@ -294,7 +281,7 @@
- {{svg "octicon-alert" 16}}
+ {{svg "octicon-alert"}}
{{$.locale.Tr "repo.pulls.is_empty"}}
{{end}}
@@ -430,7 +417,7 @@
{{range .ChangedProtectedFiles}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 86796a91cb..c8e65d0900 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -54,37 +54,27 @@ {{range .PullReviewers}}
{{if .User}}
-
- {{avatar $.Context .User 28 "gt-mr-3"}}
- {{.User.GetDisplayName}}
-
+ {{avatar $.Context .User 28 "gt-mr-3"}}{{.User.GetDisplayName}}
{{else if .Team}}
{{svg "octicon-people" 16 "teamavatar"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}
{{end}}
-
-
+
{{if .CanChange}}
-
- {{if .Checked}} {{svg "octicon-trash"}} {{else}} {{svg "octicon-sync"}} {{end}}
-
+ {{if .Checked}}{{svg "octicon-trash"}}{{else}}{{svg "octicon-sync"}}{{end}}
{{end}}
- {{svg (printf "octicon-%s" .Review.Type.Icon)}}
+ {{svg (printf "octicon-%s" .Review.Type.Icon) 16 (printf "text %s" (.Review.HTMLTypeColorName))}}
{{end}}
{{range .OriginalReviews}}
-
+
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{.OriginalAuthor}}
-