]> source.dussan.org Git - gitea.git/commitdiff
Use yellow if an approved review is stale (#26312)
authorsebastian-sauer <sauer.sebastian@gmail.com>
Thu, 3 Aug 2023 21:28:21 +0000 (23:28 +0200)
committerGitHub <noreply@github.com>
Thu, 3 Aug 2023 21:28:21 +0000 (00:28 +0300)
By using a different color it's clear that the review isn't pointing to
the latest commit.

**Screenshots:**
Not stale review:

![image](https://github.com/go-gitea/gitea/assets/1135157/2901ad69-e0d8-4041-b760-277d02dafd45)
Stale review:

![image](https://github.com/go-gitea/gitea/assets/1135157/500b306e-a994-42d4-a2fd-1174774ba5ee)

fixes #26306

models/issues/review.go

index b2736044fce0b5df4b7ab0c808a906a0f84197ae..cae3ef1d395e5bd3922f0aaf0b200aa5806b4007 100644 (file)
@@ -192,6 +192,9 @@ func (r *Review) LoadAttributes(ctx context.Context) (err error) {
 func (r *Review) HTMLTypeColorName() string {
        switch r.Type {
        case ReviewTypeApprove:
+               if r.Stale {
+                       return "yellow"
+               }
                return "green"
        case ReviewTypeComment:
                return "grey"