aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-05-10 11:16:44 +0200
committerGitHub <noreply@github.com>2023-05-10 09:16:44 +0000
commitae0fa64ef6261bc99b9b7f6af2047c017399f509 (patch)
tree7030ecbf41892701309813250984bd5e4d2f0dd0 /models
parent8bbbf7e6b8af072e8c924982019c1fc544403196 (diff)
downloadgitea-ae0fa64ef6261bc99b9b7f6af2047c017399f509.tar.gz
gitea-ae0fa64ef6261bc99b9b7f6af2047c017399f509.zip
Review fixes and enhancements (#24526)
- Fix regression with icons wrapping from https://github.com/go-gitea/gitea/pull/24459 - Fix box misalignment on small screen - Fix avatar misalignment on review comment - Fix incorrect underline hover effect on review icons - Move status icon to left side in review box - Enhance review icon colors, add helper function for it - Add missing inline avatars in review comments - Tweak icon sizes because some octicons have inconsistent sizing ### Before <img width="655" alt="Screenshot 2023-05-04 at 20 50 28" src="https://user-images.githubusercontent.com/115237/236301230-92325507-6e03-47ac-bfb4-c9ddde310571.png"> <img width="260" alt="Screenshot 2023-05-04 at 20 50 42" src="https://user-images.githubusercontent.com/115237/236301236-0dfa50e7-b8fc-4179-ae68-d872bc90f1f3.png"> ### After <img width="498" alt="Screenshot 2023-05-04 at 20 55 08" src="https://user-images.githubusercontent.com/115237/236301810-23862c2c-c0a9-43a4-a3eb-ee611c14a7f4.png"> <img width="219" alt="Screenshot 2023-05-04 at 20 55 16" src="https://user-images.githubusercontent.com/115237/236301817-d0de02ea-6ab5-43e1-9183-6b3848b72995.png"> --------- Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'models')
-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)