1
0
Fork 0
forked from forgejo/forgejo

Add support for "Show/Hide outdated"

Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
Jonas Franz 2018-05-15 16:34:19 +02:00
parent 7c1edf93ff
commit 8bb51135b6
No known key found for this signature in database
GPG key ID: 506AEEBE80BEDECD
6 changed files with 38 additions and 8 deletions

View file

@ -853,8 +853,13 @@ func fetchCodeCommentsByReview(e Engine, issue *Issue, currentUser *User, review
IssueID: issue.ID,
ReviewID: review.ID,
}
conds := opts.toConds()
if review.ID == 0 {
conds.And(builder.Eq{"invalidated": false})
}
var comments []*Comment
if err := e.Where(opts.toConds().And(builder.Eq{"invalidated": false})).
if err := e.Where(conds).
Asc("comment.created_unix").
Asc("comment.id").
Find(&comments); err != nil {