]> source.dussan.org Git - gitea.git/commitdiff
Only show accessible teams in dashboard dropdown list (#19642) (#19645)
authorJimmy Praet <jimmy.praet@telenet.be>
Sat, 7 May 2022 15:50:34 +0000 (17:50 +0200)
committerGitHub <noreply@github.com>
Sat, 7 May 2022 15:50:34 +0000 (17:50 +0200)
Fixes #19637

modules/context/org.go
templates/user/dashboard/navbar.tmpl

index 824f22b2f3305386419d3e4915f866f99a492c03..8d82abbee1f8a17d257d0a451c1b86fbf899f5e5 100644 (file)
@@ -70,12 +70,6 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
        org := ctx.Org.Organization
        ctx.Data["Org"] = org
 
-       teams, err := org.LoadTeams()
-       if err != nil {
-               ctx.ServerError("LoadTeams", err)
-       }
-       ctx.Data["OrgTeams"] = teams
-
        // Admin has super access.
        if ctx.IsSigned && ctx.User.IsAdmin {
                ctx.Org.IsOwner = true
index e995db81d8a07a4799b73d029c431f4262621091..7127abeb0b219808ae496ec13950abd9f3d87a2e 100644 (file)
@@ -61,7 +61,7 @@
                                                        <a class="{{if not $.Team}}active selected{{end}} item" title="{{.i18n.Tr "all"}}" href="{{$.Org.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
                                                                {{.i18n.Tr "all"}}
                                                        </a>
-                                                       {{range .OrgTeams}}
+                                                       {{range .Teams}}
                                                                {{if not .IncludesAllRepositories}}
                                                                        <a class="{{if $.Team}}{{if eq $.Team.ID .ID}}active selected{{end}}{{end}} item" title="{{.Name}}" href="{{$.Org.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}/{{.Name}}">
                                                                                {{.Name}}