mirror of
https://github.com/go-gitea/gitea
synced 2025-12-07 13:28:25 +00:00
Merge branch 'main' into lunny/issue_dev
This commit is contained in:
@@ -214,9 +214,13 @@ func (r *Review) LoadAttributes(ctx context.Context) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
// HTMLTypeColorName returns the color used in the ui indicating the review
|
||||
func (r *Review) HTMLTypeColorName() string {
|
||||
switch r.Type {
|
||||
case ReviewTypeApprove:
|
||||
if !r.Official {
|
||||
return "grey"
|
||||
}
|
||||
if r.Stale {
|
||||
return "yellow"
|
||||
}
|
||||
@@ -231,6 +235,27 @@ func (r *Review) HTMLTypeColorName() string {
|
||||
return "grey"
|
||||
}
|
||||
|
||||
// TooltipContent returns the locale string describing the review type
|
||||
func (r *Review) TooltipContent() string {
|
||||
switch r.Type {
|
||||
case ReviewTypeApprove:
|
||||
if r.Stale {
|
||||
return "repo.issues.review.stale"
|
||||
}
|
||||
if !r.Official {
|
||||
return "repo.issues.review.unofficial"
|
||||
}
|
||||
return "repo.issues.review.official"
|
||||
case ReviewTypeComment:
|
||||
return "repo.issues.review.comment"
|
||||
case ReviewTypeReject:
|
||||
return "repo.issues.review.rejected"
|
||||
case ReviewTypeRequest:
|
||||
return "repo.issues.review.requested"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// GetReviewByID returns the review by the given ID
|
||||
func GetReviewByID(ctx context.Context, id int64) (*Review, error) {
|
||||
review := new(Review)
|
||||
|
||||
Reference in New Issue
Block a user