summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmd/web.go3
-rwxr-xr-xpublic/css/gogs.css2
-rw-r--r--routers/org/org.go4
-rw-r--r--routers/org/teams.go16
-rw-r--r--templates/org/new_team.tmpl74
-rw-r--r--templates/org/teams.tmpl6
6 files changed, 100 insertions, 5 deletions
diff --git a/cmd/web.go b/cmd/web.go
index 729a1ba28f..bf84d5872b 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -194,7 +194,10 @@ func runWeb(*cli.Context) {
r.Get("/:org", org.Organization)
r.Get("/:org/dashboard", org.Dashboard)
r.Get("/:org/members", org.Members)
+ // organization teams
+ r.Get("/:org/teams/new",org.NewTeam)
r.Get("/:org/teams", org.Teams)
+
r.Get("/:org/settings", org.Settings)
r.Post("/:org/settings", bindIgnErr(auth.OrgSettingForm{}), org.SettingsPost)
}, reqSignIn)
diff --git a/public/css/gogs.css b/public/css/gogs.css
index 960176f582..eb95a1d088 100755
--- a/public/css/gogs.css
+++ b/public/css/gogs.css
@@ -375,7 +375,7 @@ html, body {
/* gogits repo create */
-#repo-create, #org-create {
+#repo-create, #org-create, #org-teams-create {
width: 800px;
}
diff --git a/routers/org/org.go b/routers/org/org.go
index 4f57b9a963..c036a8e5dc 100644
--- a/routers/org/org.go
+++ b/routers/org/org.go
@@ -30,10 +30,6 @@ func Members(ctx *middleware.Context, params martini.Params) {
ctx.HTML(200, "org/members")
}
-func Teams(ctx *middleware.Context, params martini.Params) {
- ctx.Data["Title"] = "Organization " + params["org"] + " Teams"
- ctx.HTML(200, "org/teams")
-}
func New(ctx *middleware.Context) {
ctx.Data["Title"] = "Create An Organization"
diff --git a/routers/org/teams.go b/routers/org/teams.go
new file mode 100644
index 0000000000..9585cb272e
--- /dev/null
+++ b/routers/org/teams.go
@@ -0,0 +1,16 @@
+package org
+
+import (
+ "github.com/go-martini/martini"
+ "github.com/gogits/gogs/modules/middleware"
+)
+
+func Teams(ctx *middleware.Context, params martini.Params) {
+ ctx.Data["Title"] = "Organization "+params["org"]+" Teams"
+ ctx.HTML(200, "org/teams")
+}
+
+func NewTeam(ctx *middleware.Context, params martini.Params) {
+ ctx.Data["Title"] = "Organization "+params["org"]+" New Team"
+ ctx.HTML(200, "org/new_team")
+}
diff --git a/templates/org/new_team.tmpl b/templates/org/new_team.tmpl
new file mode 100644
index 0000000000..752f37d2e0
--- /dev/null
+++ b/templates/org/new_team.tmpl
@@ -0,0 +1,74 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+<div id="body-nav" class="org-nav org-nav-auto">
+ <div class="container clearfix">
+ <div id="org-nav-wrapper">
+ <ul class="nav nav-pills pull-right">
+ <li><a href="#"><i class="fa fa-users"></i>Members
+ <span class="label label-default">5</span></a>
+ </li>
+ <li class="active"><a href="#"><i class="fa fa-tags"></i>Teams
+ <span class="label label-default">2</span></a>
+ </li>
+ </ul>
+ <img class="pull-left org-small-logo" src="https://avatars3.githubusercontent.com/u/6656686?s=140" alt="" width="60"/>
+ <div id="org-nav-info">
+ <h2 class="org-name">Organization Name</h2>
+ </div>
+ </div>
+ </div>
+</div>
+<div id="body" class="container">
+ <div id="org">
+ <form id="org-teams-create" class="form-horizontal card">
+ <h3>Create new team</h3>
+ <div class="form-group">
+ <label class="col-md-2 control-label">Team Name<strong class="text-danger">*</strong></label>
+ <div class="col-md-8">
+ <input name="team" type="text" class="form-control" placeholder="Type your team name" value="" required="required">
+ <span class="help-block">You'll use this name to mention this team in conversations.</span>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-md-2 control-label">Description</label>
+ <div class="col-md-8">
+ <input name="desc" type="text" class="form-control" placeholder="Type your team description (optional)" value="">
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-md-2 control-label">Permission</label>
+ <div class="col-md-8">
+ <div class="radio">
+ <label>
+ <input type="radio" name="permission" value="pull" checked="">
+ <strong>Read & Clone</strong>
+ </label>
+ <p>This team will be able to view and clone its repositories.</p>
+ </div>
+ <div class="radio">
+ <label>
+ <input type="radio" name="permission" value="push">
+ <strong>Push, Read & Clone</strong>
+ </label>
+ <p>This team will be able to read its repositories, as well as push to them.</p>
+ </div>
+ <div class="radio">
+ <label>
+ <input type="radio" name="permission" value="admin">
+ <strong>Collaboration, Push, Read & Clone</strong>
+ </label>
+ <p>This team will be able to push/pull to its repositories, as well as add other collaborators to them.</p>
+ </div>
+ </div>
+ </div>
+ <hr/>
+ <div class="form-group">
+ <label class="col-md-2">&nbsp;</label>
+ <div class="col-md-8">
+ <button class="btn btn-primary">Create team</button>
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/org/teams.tmpl b/templates/org/teams.tmpl
index a8218812c9..90aab94401 100644
--- a/templates/org/teams.tmpl
+++ b/templates/org/teams.tmpl
@@ -21,6 +21,12 @@
<div id="body" class="container">
<div id="org">
<div id="org-teams">
+ <div id="org-teams-action">
+ <div class="col-md-12">
+ <a href="#"><button class="btn btn-success"><i class="fa fa-plus-square"></i>New Team</button></a>
+ <hr/>
+ </div>
+ </div>
<div class="org-team col-md-6">
<div class="panel panel-default">
<h2 class="panel-heading org-team-name"><a href="#"><strong>Team Name</strong></a></h2>