aboutsummaryrefslogtreecommitdiffstats
path: root/routers/org
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-05-18 22:54:24 +0800
committerGitHub <noreply@github.com>2017-05-18 22:54:24 +0800
commitfd6034aaf23af1ce03bcba0babcbe7675ce093ee (patch)
tree9720f416facdef02a76bd56ca50669cc1f17eb88 /routers/org
parent5db5e16ab61f25f21cb17ee4895679b9830641a5 (diff)
downloadgitea-fd6034aaf23af1ce03bcba0babcbe7675ce093ee.tar.gz
gitea-fd6034aaf23af1ce03bcba0babcbe7675ce093ee.zip
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
Diffstat (limited to 'routers/org')
-rw-r--r--routers/org/teams.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/org/teams.go b/routers/org/teams.go
index cbf7f19a80..914561b52a 100644
--- a/routers/org/teams.go
+++ b/routers/org/teams.go
@@ -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 {