aboutsummaryrefslogtreecommitdiffstats
path: root/models/issues/review.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issues/review.go')
-rw-r--r--models/issues/review.go14
1 files changed, 14 insertions, 0 deletions
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)