mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-06 02:15:20 +02:00
Milestone issues and pull requests (#5293)
* add milestone issues and pulls page instead of redirecting issues page * add milestone when creating issue from milestone page * refactor to merge similiar codes as a new function issues * remove milestone info on milestone issues list * fix missing params
This commit is contained in:
parent
d5d847e5c4
commit
2dc805c0c6
8 changed files with 573 additions and 262 deletions
|
@ -1401,7 +1401,7 @@ type IssueStatsOptions struct {
|
|||
AssigneeID int64
|
||||
MentionedID int64
|
||||
PosterID int64
|
||||
IsPull bool
|
||||
IsPull util.OptionalBool
|
||||
IssueIDs []int64
|
||||
}
|
||||
|
||||
|
@ -1411,8 +1411,7 @@ func GetIssueStats(opts *IssueStatsOptions) (*IssueStats, error) {
|
|||
|
||||
countSession := func(opts *IssueStatsOptions) *xorm.Session {
|
||||
sess := x.
|
||||
Where("issue.repo_id = ?", opts.RepoID).
|
||||
And("issue.is_pull = ?", opts.IsPull)
|
||||
Where("issue.repo_id = ?", opts.RepoID)
|
||||
|
||||
if len(opts.IssueIDs) > 0 {
|
||||
sess.In("issue.id", opts.IssueIDs)
|
||||
|
@ -1447,6 +1446,13 @@ func GetIssueStats(opts *IssueStatsOptions) (*IssueStats, error) {
|
|||
And("issue_user.is_mentioned = ?", true)
|
||||
}
|
||||
|
||||
switch opts.IsPull {
|
||||
case util.OptionalBoolTrue:
|
||||
sess.And("issue.is_pull=?", true)
|
||||
case util.OptionalBoolFalse:
|
||||
sess.And("issue.is_pull=?", false)
|
||||
}
|
||||
|
||||
return sess
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue