mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-25 15:53:36 +01:00
Default to showing closed Issues/PR list when there are only closed issues/PRs (#12200)
If all issues are closed, then set the default to show the closed issues.
This commit is contained in:
parent
a6168fa25d
commit
16980d13ce
1 changed files with 7 additions and 1 deletions
|
@ -139,7 +139,6 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
isShowClosed := ctx.Query("state") == "closed"
|
|
||||||
|
|
||||||
keyword := strings.Trim(ctx.Query("q"), " ")
|
keyword := strings.Trim(ctx.Query("q"), " ")
|
||||||
if bytes.Contains([]byte(keyword), []byte{0x00}) {
|
if bytes.Contains([]byte(keyword), []byte{0x00}) {
|
||||||
|
@ -177,6 +176,13 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isShowClosed := ctx.Query("state") == "closed"
|
||||||
|
// if open issues are zero and close don't, use closed as default
|
||||||
|
if len(ctx.Query("state")) == 0 && issueStats.OpenCount == 0 && issueStats.ClosedCount != 0 {
|
||||||
|
isShowClosed = true
|
||||||
|
}
|
||||||
|
|
||||||
page := ctx.QueryInt("page")
|
page := ctx.QueryInt("page")
|
||||||
if page <= 1 {
|
if page <= 1 {
|
||||||
page = 1
|
page = 1
|
||||||
|
|
Loading…
Reference in a new issue