1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Add units to team (#947)

* add units to team

* fix lint

* finish team setting backend

* finished permission controll on routes

* fix import blank line

* add unit check on ssh/http pull and push and fix test failed

* fix fixtures data

* remove unused code
This commit is contained in:
Lunny Xiao
2017-05-18 22:54:24 +08:00
committed by GitHub
parent 5db5e16ab6
commit fd6034aaf2
18 changed files with 366 additions and 113 deletions

View File

@@ -156,6 +156,7 @@ func NewTeam(ctx *context.Context) {
ctx.Data["PageIsOrgTeams"] = true
ctx.Data["PageIsOrgTeamsNew"] = true
ctx.Data["Team"] = &models.Team{}
ctx.Data["Units"] = models.Units
ctx.HTML(200, tplTeamNew)
}
@@ -170,6 +171,7 @@ func NewTeamPost(ctx *context.Context, form auth.CreateTeamForm) {
Name: form.TeamName,
Description: form.Description,
Authorize: models.ParseAccessMode(form.Permission),
UnitTypes: form.Units,
}
ctx.Data["Team"] = t
@@ -220,6 +222,7 @@ func EditTeam(ctx *context.Context) {
ctx.Data["PageIsOrgTeams"] = true
ctx.Data["team_name"] = ctx.Org.Team.Name
ctx.Data["desc"] = ctx.Org.Team.Description
ctx.Data["Units"] = models.Units
ctx.HTML(200, tplTeamNew)
}
@@ -258,6 +261,7 @@ func EditTeamPost(ctx *context.Context, form auth.CreateTeamForm) {
}
}
t.Description = form.Description
t.UnitTypes = form.Units
if err := models.UpdateTeam(t, isAuthChanged); err != nil {
ctx.Data["Err_TeamName"] = true
switch {