summaryrefslogtreecommitdiffstats
path: root/routers/org
diff options
context:
space:
mode:
authorDavid Svantesson <davidsvantesson@gmail.com>2019-11-09 01:39:37 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2019-11-09 08:39:37 +0800
commit9ae4c17cb1fde0eaa1556e545a8871b6a70d2efa (patch)
tree0a62a8bd50dcb4d067f915d02b24207e2a714e5f /routers/org
parentd2aee2a3e259de0d9dfd20452d55eb0c34ccc874 (diff)
downloadgitea-9ae4c17cb1fde0eaa1556e545a8871b6a70d2efa.tar.gz
gitea-9ae4c17cb1fde0eaa1556e545a8871b6a70d2efa.zip
Allow to add and remove all repositories to/from team. (#8867)
* Allow to add and remove all repositories to team. * Change style, buttons on same row. * Apply suggestions from code review Grammar Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Move set num repos to lower function. * Make general language sentences
Diffstat (limited to 'routers/org')
-rw-r--r--routers/org/teams.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/routers/org/teams.go b/routers/org/teams.go
index 24612459a4..36a2847355 100644
--- a/routers/org/teams.go
+++ b/routers/org/teams.go
@@ -155,6 +155,10 @@ func TeamsRepoAction(ctx *context.Context) {
err = ctx.Org.Team.AddRepository(repo)
case "remove":
err = ctx.Org.Team.RemoveRepository(com.StrTo(ctx.Query("repoid")).MustInt64())
+ case "addall":
+ err = ctx.Org.Team.AddAllRepositories()
+ case "removeall":
+ err = ctx.Org.Team.RemoveAllRepositories()
}
if err != nil {
@@ -162,6 +166,10 @@ func TeamsRepoAction(ctx *context.Context) {
ctx.ServerError("TeamsRepoAction", err)
return
}
+
+ ctx.JSON(200, map[string]interface{}{
+ "redirect": ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories",
+ })
ctx.Redirect(ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories")
}