Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix correct usage of teams #17732

Merged
merged 2 commits into from
Nov 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions modules/context/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ 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
Expand Down
4 changes: 2 additions & 2 deletions templates/user/dashboard/navbar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 .Org.Teams}}
{{range .OrgTeams}}
{{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}}
Expand All @@ -85,7 +85,7 @@
</a>
{{end}}
{{if not .UnitPullsGlobalDisabled}}
<a class="{{if .PageIsPulls}}active{{end}} item" href="{{.ContextUser.OrganisationLink}}/pulls{{if .Team}}/{{PathEscape.Team.Name}}{{end}}">
<a class="{{if .PageIsPulls}}active{{end}} item" href="{{.ContextUser.OrganisationLink}}/pulls{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
{{svg "octicon-git-pull-request"}}&nbsp;{{.i18n.Tr "pull_requests"}}
</a>
{{end}}
Expand Down