mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 03:38:52 +03:00
Backport #20785 This fixes a problem where the "All" line item on the Issues or Pull Requests page was only showing the count of the selected repos instead of the total of all issues/prs in all repos. The "total number of shown issues" number is now stashed in a different context variable in case it wants to be used by the frontend later. It's currently not being used. Fixes #20574
This commit is contained in:
parent
78dabdd9ae
commit
79fa1c15a4
1 changed files with 6 additions and 2 deletions
|
@ -607,10 +607,8 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
|
||||||
var shownIssues int
|
var shownIssues int
|
||||||
if !isShowClosed {
|
if !isShowClosed {
|
||||||
shownIssues = int(issueStats.OpenCount)
|
shownIssues = int(issueStats.OpenCount)
|
||||||
ctx.Data["TotalIssueCount"] = shownIssues
|
|
||||||
} else {
|
} else {
|
||||||
shownIssues = int(issueStats.ClosedCount)
|
shownIssues = int(issueStats.ClosedCount)
|
||||||
ctx.Data["TotalIssueCount"] = shownIssues
|
|
||||||
}
|
}
|
||||||
if len(repoIDs) != 0 {
|
if len(repoIDs) != 0 {
|
||||||
shownIssues = 0
|
shownIssues = 0
|
||||||
|
@ -619,6 +617,12 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var allIssueCount int64
|
||||||
|
for _, issueCount := range issueCountByRepo {
|
||||||
|
allIssueCount += issueCount
|
||||||
|
}
|
||||||
|
ctx.Data["TotalIssueCount"] = allIssueCount
|
||||||
|
|
||||||
ctx.Data["IsShowClosed"] = isShowClosed
|
ctx.Data["IsShowClosed"] = isShowClosed
|
||||||
|
|
||||||
ctx.Data["IssueRefEndNames"], ctx.Data["IssueRefURLs"] = issue_service.GetRefEndNamesAndURLs(issues, ctx.FormString("RepoLink"))
|
ctx.Data["IssueRefEndNames"], ctx.Data["IssueRefURLs"] = issue_service.GetRefEndNamesAndURLs(issues, ctx.FormString("RepoLink"))
|
||||||
|
|
Loading…
Reference in a new issue