Skip to content

Commit

Permalink
Add highlight to selected repos in milestone dashboard (#26300)
Browse files Browse the repository at this point in the history
  • Loading branch information
yp05327 and GiteaBot authored Aug 4, 2023
1 parent 6a7a5ea commit 945a0cb
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions routers/web/user/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,19 @@ func Milestones(ctx *context.Context) {
}
}

showRepoIds := make(container.Set[int64], len(showRepos))
for _, repo := range showRepos {
if repo.ID > 0 {
showRepoIds.Add(repo.ID)
}
}
if len(repoIDs) == 0 {
repoIDs = showRepoIds.Values()
}
repoIDs = util.SliceRemoveAllFunc(repoIDs, func(v int64) bool {
return !showRepoIds.Contains(v)
})

var pagerCount int
if isShowClosed {
ctx.Data["State"] = "closed"
Expand All @@ -298,9 +311,7 @@ func Milestones(ctx *context.Context) {
ctx.Data["MilestoneStats"] = milestoneStats
ctx.Data["SortType"] = sortType
ctx.Data["Keyword"] = keyword
if milestoneStats.Total() != totalMilestoneStats.Total() {
ctx.Data["RepoIDs"] = repoIDs
}
ctx.Data["RepoIDs"] = repoIDs
ctx.Data["IsShowClosed"] = isShowClosed

pager := context.NewPagination(pagerCount, setting.UI.IssuePagingNum, page, 5)
Expand Down

0 comments on commit 945a0cb

Please sign in to comment.