1
0
Fork 0
forked from forgejo/forgejo

Count only visible repos on profile (#25928)

Fixes #25914
This commit is contained in:
JakobDev 2023-08-11 19:08:05 +02:00 committed by GitHub
parent 7e382a5555
commit f3fbb7c67d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 211 additions and 106 deletions

View file

@ -101,6 +101,12 @@ func Projects(ctx *context.Context) {
project.RenderedContent = project.Description
}
err = shared_user.LoadHeaderCount(ctx)
if err != nil {
ctx.ServerError("LoadHeaderCount", err)
return
}
numPages := 0
if total > 0 {
numPages = (int(total) - 1/setting.UI.IssuePagingNum)
@ -135,6 +141,13 @@ func RenderNewProject(ctx *context.Context) {
ctx.Data["HomeLink"] = ctx.ContextUser.HomeLink()
ctx.Data["CancelLink"] = ctx.ContextUser.HomeLink() + "/-/projects"
shared_user.RenderUserHeader(ctx)
err := shared_user.LoadHeaderCount(ctx)
if err != nil {
ctx.ServerError("LoadHeaderCount", err)
return
}
ctx.HTML(http.StatusOK, tplProjectsNew)
}
@ -270,6 +283,12 @@ func EditProjectPost(ctx *context.Context) {
shared_user.RenderUserHeader(ctx)
err := shared_user.LoadHeaderCount(ctx)
if err != nil {
ctx.ServerError("LoadHeaderCount", err)
return
}
if ctx.HasError() {
ctx.HTML(http.StatusOK, tplProjectsNew)
return
@ -379,6 +398,12 @@ func ViewProject(ctx *context.Context) {
ctx.Data["Boards"] = boards
shared_user.RenderUserHeader(ctx)
err = shared_user.LoadHeaderCount(ctx)
if err != nil {
ctx.ServerError("LoadHeaderCount", err)
return
}
ctx.HTML(http.StatusOK, tplProjectsView)
}