{{template "base/head" .}}
{{template "repo/header" .}} {{template "repo/settings/navbar" .}}
{{template "base/alert" .}}

{{.i18n.Tr "repo.settings.collaboration"}}

{{if .Collaborators}}
{{range .Collaborators}}
{{svg "octicon-shield-lock" 16}}
{{end}}
{{end}}
{{.CsrfTokenHtml}}
{{if .RepoOwnerIsOrganization}}

{{$.i18n.Tr "repo.settings.teams"}}

{{ $allowedToChangeTeams := ( or (.Org.RepoAdminChangeTeamAccess) (.Permission.IsOwner)) }} {{if .Teams}}
{{range $t, $team := .Teams}}
{{svg "octicon-shield-lock" 16}} {{ if or (eq .Authorize 1) (eq .Authorize 2) }} {{ $first := true }}
Sections: {{range $u, $unit := $.Units}}{{if and ($.Repo.UnitEnabled $unit.Type) ($team.UnitEnabled $unit.Type)}}{{if $first}}{{ $first = false }}{{else}}, {{end}}{{$.i18n.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}}
{{end}}
{{if $allowedToChangeTeams}}
{{end}}
{{end}}
{{end}}
{{if $allowedToChangeTeams}}
{{.CsrfTokenHtml}}
{{else}}
{{$.i18n.Tr "repo.settings.change_team_access_not_allowed"}}
{{end}}
{{end}}
{{template "base/footer" .}}