mirror of
https://github.com/go-gitea/gitea
synced 2024-11-22 03:51:02 +01:00
Add highlight to selected repos in milestone dashboard (#26300)
Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/d3fa1e15-423a-4216-8a60-b02f5aa4f5d3) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/643df586-ec2f-4480-b7a0-bd252883d761) Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
6a7a5ea32a
commit
945a0cb96b
1 changed files with 14 additions and 3 deletions
|
@ -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"
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue