From e544a277fe261aa5671a20751d6f83126579334a Mon Sep 17 00:00:00 2001 From: 853 Date: Wed, 25 Oct 2023 13:55:56 +0800 Subject: [PATCH] Fix the missing repo count in new team page and edit team page (#27743) Follow #26942 Before: ![image](https://github.com/go-gitea/gitea/assets/8389962/ffe3e914-c71c-493f-965b-369f27c70b4b) ![image](https://github.com/go-gitea/gitea/assets/8389962/eaad4f07-b8ce-4564-b883-97938de5ed79) After: ![image](https://github.com/go-gitea/gitea/assets/8389962/353aeabe-caf4-4449-8330-d3a29f9bd326) ![image](https://github.com/go-gitea/gitea/assets/8389962/baf59bb6-2c74-4a56-a28c-1519bc3d2594) --- routers/web/org/teams.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/routers/web/org/teams.go b/routers/web/org/teams.go index 183b7dd266..9e65c8ba9c 100644 --- a/routers/web/org/teams.go +++ b/routers/web/org/teams.go @@ -276,6 +276,10 @@ func NewTeam(ctx *context.Context) { ctx.Data["PageIsOrgTeamsNew"] = true ctx.Data["Team"] = &org_model.Team{} ctx.Data["Units"] = unit_model.Units + if err := shared_user.LoadHeaderCount(ctx); err != nil { + ctx.ServerError("LoadHeaderCount", err) + return + } ctx.HTML(http.StatusOK, tplTeamNew) } @@ -463,6 +467,10 @@ func EditTeam(ctx *context.Context) { ctx.ServerError("LoadUnits", err) return } + if err := shared_user.LoadHeaderCount(ctx); err != nil { + ctx.ServerError("LoadHeaderCount", err) + return + } ctx.Data["Team"] = ctx.Org.Team ctx.Data["Units"] = unit_model.Units ctx.HTML(http.StatusOK, tplTeamNew)