From 4fcbf553aa9b451bc461e09a98711966668e1889 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Sat, 7 Jun 2014 13:27:24 +0800 Subject: organisation main page ui --- public/css/gogs.css | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) (limited to 'public/css/gogs.css') diff --git a/public/css/gogs.css b/public/css/gogs.css index 79fd4bf9..09249811 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -1643,7 +1643,7 @@ html, body { vertical-align: top; } -#label-color-change-ipt2{ +#label-color-change-ipt2 { margin-top: 1px; } @@ -1814,4 +1814,96 @@ html, body { #release-preview { margin: 6px 0; +} + +/* organization */ + +#body-nav.org-nav { + height: 140px; + padding: 16px 0; +} + +.org-nav .org-logo { + margin-right: 16px; + width: 100px; + height: 100px; +} + +.org-nav .org-name { + margin-top: 0; +} + +.org-description { + font-size: 16px; +} + +.org-meta li, .org-meta li a, .org-repo-update, .org-repo-status, .org-team-meta { + color: #888; +} + +.org-meta li { + margin-right: 12px; +} + +.org-meta li a:hover { + text-decoration: underline; +} + +.org-meta .fa { + margin-left: 0; +} + +.org-sidebar { + margin-top: -100px; +} + +.org-panel .panel-heading { + font-size: 18px; +} + +.org-repo-status { + font-family: Verdana, Arial, Helvetica, sans-serif; +} + +.org-repo-item { + border-bottom: 1px solid #DDD; + padding-bottom: 18px; +} + +.org-member img { + width: 60px; + height: 60px; + border-radius: 4px; +} + +.org-member { + display: inline-block; + padding: 2px; +} + +.org-team-name { + font-size: 15px; + margin-bottom: 0; + color: #444; +} + +.org-team { + border-bottom: 1px solid #DDD; + margin-bottom: 12px; +} + +.org-team:last-child { + border: none; +} + +.org-team a { + display: block; +} + +.org-team a:hover { + text-decoration: none; +} + +.org-team a:hover .org-team-name { + color: #0079bc !important; } \ No newline at end of file -- cgit v1.2.3 From f160b4f33ca69df13b071648aad09e561dafec26 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 8 Jun 2014 17:53:53 -0400 Subject: Add tar.gz download button and other mirror updates --- models/login.go | 83 ++++++++++++++++++++++--------------------------- models/repo.go | 57 ++++++++++++++++----------------- models/user.go | 2 +- public/css/gogs.css | 2 +- routers/admin/auths.go | 18 +++++------ routers/admin/user.go | 5 +-- templates/repo/nav.tmpl | 1 + 7 files changed, 79 insertions(+), 89 deletions(-) (limited to 'public/css/gogs.css') diff --git a/models/login.go b/models/login.go index 984a9f8c..863ba44e 100644 --- a/models/login.go +++ b/models/login.go @@ -1,4 +1,4 @@ -// Copyright github.com/juju2013. All rights reserved. +// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. @@ -20,12 +20,13 @@ import ( "github.com/gogits/gogs/modules/log" ) -// Login types. +type LoginType int + const ( - LT_NOTYPE = iota - LT_PLAIN - LT_LDAP - LT_SMTP + NOTYPE LoginType = iota + PLAIN + LDAP + SMTP ) var ( @@ -34,9 +35,9 @@ var ( ErrAuthenticationUserUsed = errors.New("Authentication has been used by some users") ) -var LoginTypes = map[int]string{ - LT_LDAP: "LDAP", - LT_SMTP: "SMTP", +var LoginTypes = map[LoginType]string{ + LDAP: "LDAP", + SMTP: "SMTP", } // Ensure structs implmented interface. @@ -49,7 +50,6 @@ type LDAPConfig struct { ldap.Ldapsource } -// implement func (cfg *LDAPConfig) FromDB(bs []byte) error { return json.Unmarshal(bs, &cfg.Ldapsource) } @@ -65,7 +65,6 @@ type SMTPConfig struct { TLS bool } -// implement func (cfg *SMTPConfig) FromDB(bs []byte) error { return json.Unmarshal(bs, cfg) } @@ -76,13 +75,13 @@ func (cfg *SMTPConfig) ToDB() ([]byte, error) { type LoginSource struct { Id int64 - Type int - Name string `xorm:"unique"` - IsActived bool `xorm:"not null default false"` + Type LoginType + Name string `xorm:"UNIQUE"` + IsActived bool `xorm:"NOT NULL DEFAULT false"` Cfg core.Conversion `xorm:"TEXT"` - Created time.Time `xorm:"created"` - Updated time.Time `xorm:"updated"` - AllowAutoRegister bool `xorm:"not null default false"` + AllowAutoRegister bool `xorm:"NOT NULL DEFAULT false"` + Created time.Time `xorm:"CREATED"` + Updated time.Time `xorm:"UPDATED"` } func (source *LoginSource) TypeString() string { @@ -97,21 +96,25 @@ func (source *LoginSource) SMTP() *SMTPConfig { return source.Cfg.(*SMTPConfig) } -// for xorm callback func (source *LoginSource) BeforeSet(colName string, val xorm.Cell) { if colName == "type" { ty := (*val).(int64) - switch ty { - case LT_LDAP: + switch LoginType(ty) { + case LDAP: source.Cfg = new(LDAPConfig) - case LT_SMTP: + case SMTP: source.Cfg = new(SMTPConfig) } } } +func CreateSource(source *LoginSource) error { + _, err := orm.Insert(source) + return err +} + func GetAuths() ([]*LoginSource, error) { - var auths = make([]*LoginSource, 0) + var auths = make([]*LoginSource, 0, 5) err := orm.Find(&auths) return auths, err } @@ -121,18 +124,12 @@ func GetLoginSourceById(id int64) (*LoginSource, error) { has, err := orm.Id(id).Get(source) if err != nil { return nil, err - } - if !has { + } else if !has { return nil, ErrAuthenticationNotExist } return source, nil } -func AddSource(source *LoginSource) error { - _, err := orm.Insert(source) - return err -} - func UpdateSource(source *LoginSource) error { _, err := orm.Id(source.Id).AllCols().Update(source) return err @@ -164,14 +161,14 @@ func UserSignIn(uname, passwd string) (*User, error) { return nil, err } - if u.LoginType == LT_NOTYPE { + if u.LoginType == NOTYPE { if has { - u.LoginType = LT_PLAIN + u.LoginType = PLAIN } } // for plain login, user must have existed. - if u.LoginType == LT_PLAIN { + if u.LoginType == PLAIN { if !has { return nil, ErrUserNotExist } @@ -191,22 +188,20 @@ func UserSignIn(uname, passwd string) (*User, error) { } for _, source := range sources { - if source.Type == LT_LDAP { + if source.Type == LDAP { u, err := LoginUserLdapSource(nil, uname, passwd, source.Id, source.Cfg.(*LDAPConfig), true) if err == nil { return u, nil - } else { - log.Warn("Fail to login(%s) by LDAP(%s): %v", uname, source.Name, err) } - } else if source.Type == LT_SMTP { + log.Warn("Fail to login(%s) by LDAP(%s): %v", uname, source.Name, err) + } else if source.Type == SMTP { u, err := LoginUserSMTPSource(nil, uname, passwd, source.Id, source.Cfg.(*SMTPConfig), true) if err == nil { return u, nil - } else { - log.Warn("Fail to login(%s) by SMTP(%s): %v", uname, source.Name, err) } + log.Warn("Fail to login(%s) by SMTP(%s): %v", uname, source.Name, err) } } @@ -224,10 +219,10 @@ func UserSignIn(uname, passwd string) (*User, error) { } switch u.LoginType { - case LT_LDAP: + case LDAP: return LoginUserLdapSource(u, u.LoginName, passwd, source.Id, source.Cfg.(*LDAPConfig), false) - case LT_SMTP: + case SMTP: return LoginUserSMTPSource(u, u.LoginName, passwd, source.Id, source.Cfg.(*SMTPConfig), false) } @@ -252,7 +247,7 @@ func LoginUserLdapSource(user *User, name, passwd string, sourceId int64, cfg *L user = &User{ LowerName: strings.ToLower(name), Name: strings.ToLower(name), - LoginType: LT_LDAP, + LoginType: LDAP, LoginSource: sourceId, LoginName: name, IsActive: true, @@ -320,9 +315,8 @@ func SmtpAuth(host string, port int, a smtp.Auth, useTls bool) error { return err } return nil - } else { - return ErrUnsupportedLoginType } + return ErrUnsupportedLoginType } // Query if name/passwd can login against the LDAP direcotry pool @@ -358,13 +352,12 @@ func LoginUserSMTPSource(user *User, name, passwd string, sourceId int64, cfg *S user = &User{ LowerName: strings.ToLower(loginName), Name: strings.ToLower(loginName), - LoginType: LT_SMTP, + LoginType: SMTP, LoginSource: sourceId, LoginName: name, IsActive: true, Passwd: passwd, Email: name, } - return RegisterUser(user) } diff --git a/models/repo.go b/models/repo.go index 869059fa..deb25b2a 100644 --- a/models/repo.go +++ b/models/repo.go @@ -109,11 +109,11 @@ func NewRepoContext() { // Repository represents a git repository. type Repository struct { Id int64 - OwnerId int64 `xorm:"unique(s)"` + OwnerId int64 `xorm:"UNIQUE(s)"` Owner *User `xorm:"-"` ForkId int64 - LowerName string `xorm:"unique(s) index not null"` - Name string `xorm:"index not null"` + LowerName string `xorm:"UNIQUE(s) INDEX NOT NULL"` + Name string `xorm:"INDEX NOT NULL"` Description string Website string NumWatches int @@ -131,8 +131,8 @@ type Repository struct { IsBare bool IsGoget bool DefaultBranch string - Created time.Time `xorm:"created"` - Updated time.Time `xorm:"updated"` + Created time.Time `xorm:"CREATED"` + Updated time.Time `xorm:"UPDATED"` } func (repo *Repository) GetOwner() (err error) { @@ -184,6 +184,25 @@ type Mirror struct { NextUpdate time.Time } +// MirrorRepository creates a mirror repository from source. +func MirrorRepository(repoId int64, userName, repoName, repoPath, url string) error { + _, stderr, err := com.ExecCmd("git", "clone", "--mirror", url, repoPath) + if err != nil { + return errors.New("git clone --mirror: " + stderr) + } + + if _, err = orm.InsertOne(&Mirror{ + RepoId: repoId, + RepoName: strings.ToLower(userName + "/" + repoName), + Interval: 24, + NextUpdate: time.Now().Add(24 * time.Hour), + }); err != nil { + return err + } + + return git.UnpackRefs(repoPath) +} + func GetMirror(repoId int64) (*Mirror, error) { m := &Mirror{RepoId: repoId} has, err := orm.Get(m) @@ -223,25 +242,6 @@ func MirrorUpdate() { } } -// MirrorRepository creates a mirror repository from source. -func MirrorRepository(repoId int64, userName, repoName, repoPath, url string) error { - _, stderr, err := com.ExecCmd("git", "clone", "--mirror", url, repoPath) - if err != nil { - return errors.New("git clone --mirror: " + stderr) - } - - if _, err = orm.InsertOne(&Mirror{ - RepoId: repoId, - RepoName: strings.ToLower(userName + "/" + repoName), - Interval: 24, - NextUpdate: time.Now().Add(24 * time.Hour), - }); err != nil { - return err - } - - return git.UnpackRefs(repoPath) -} - // MigrateRepository migrates a existing repository from other project hosting. func MigrateRepository(user *User, name, desc string, private, mirror bool, url string) (*Repository, error) { repo, err := CreateRepository(user, name, desc, "", "", private, mirror, false) @@ -746,16 +746,11 @@ func DeleteRepository(userId, repoId int64, userName string) (err error) { sess.Rollback() return err } - if err = sess.Commit(); err != nil { - sess.Rollback() - return err - } if err = os.RemoveAll(RepoPath(userName, repo.Name)); err != nil { - // TODO: log and delete manully - log.Error("delete repo %s/%s failed: %v", userName, repo.Name, err) + sess.Rollback() return err } - return nil + return sess.Commit() } // GetRepositoryByName returns the repository by given name under user if exists. diff --git a/models/user.go b/models/user.go index 78ab4642..04ea1fd6 100644 --- a/models/user.go +++ b/models/user.go @@ -47,7 +47,7 @@ type User struct { FullName string Email string `xorm:"unique not null"` Passwd string `xorm:"not null"` - LoginType int + LoginType LoginType LoginSource int64 `xorm:"not null default 0"` LoginName string Type int diff --git a/public/css/gogs.css b/public/css/gogs.css index 09249811..1e29eeba 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -10,7 +10,7 @@ body { html, body { height: 100%; - font-family: Helvetica, Arial, sans-serif; + font-family: Arial, Helvetica, sans-serif; } /* override bs3 */ diff --git a/routers/admin/auths.go b/routers/admin/auths.go index c4702afc..e0b99714 100644 --- a/routers/admin/auths.go +++ b/routers/admin/auths.go @@ -38,8 +38,8 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { } var u core.Conversion - switch form.Type { - case models.LT_LDAP: + switch models.LoginType(form.Type) { + case models.LDAP: u = &models.LDAPConfig{ Ldapsource: ldap.Ldapsource{ Host: form.Host, @@ -53,7 +53,7 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { Name: form.AuthName, }, } - case models.LT_SMTP: + case models.SMTP: u = &models.SMTPConfig{ Auth: form.SmtpAuth, Host: form.SmtpHost, @@ -66,14 +66,14 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { } var source = &models.LoginSource{ - Type: form.Type, + Type: models.LoginType(form.Type), Name: form.AuthName, IsActived: true, AllowAutoRegister: form.AllowAutoRegister, Cfg: u, } - if err := models.AddSource(source); err != nil { + if err := models.CreateSource(source); err != nil { ctx.Handle(500, "admin.auths.NewAuth", err) return } @@ -116,8 +116,8 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { } var config core.Conversion - switch form.Type { - case models.LT_LDAP: + switch models.LoginType(form.Type) { + case models.LDAP: config = &models.LDAPConfig{ Ldapsource: ldap.Ldapsource{ Host: form.Host, @@ -131,7 +131,7 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { Name: form.AuthName, }, } - case models.LT_SMTP: + case models.SMTP: config = &models.SMTPConfig{ Auth: form.SmtpAuth, Host: form.SmtpHost, @@ -147,7 +147,7 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { Id: form.Id, Name: form.AuthName, IsActived: form.IsActived, - Type: form.Type, + Type: models.LoginType(form.Type), AllowAutoRegister: form.AllowAutoRegister, Cfg: config, } diff --git a/routers/admin/user.go b/routers/admin/user.go index fa98bd32..596fe7b1 100644 --- a/routers/admin/user.go +++ b/routers/admin/user.go @@ -51,12 +51,13 @@ func NewUserPost(ctx *middleware.Context, form auth.RegisterForm) { Email: form.Email, Passwd: form.Password, IsActive: true, - LoginType: models.LT_PLAIN, + LoginType: models.PLAIN, } if len(form.LoginType) > 0 { fields := strings.Split(form.LoginType, "-") - u.LoginType, _ = strconv.Atoi(fields[0]) + tp, _ := strconv.Atoi(fields[0]) + u.LoginType = models.LoginType(tp) u.LoginSource, _ = strconv.ParseInt(fields[1], 10, 64) u.LoginName = form.LoginName fmt.Println(u.LoginType, u.LoginSource, u.LoginName) diff --git a/templates/repo/nav.tmpl b/templates/repo/nav.tmpl index 70e1745f..ea7799b3 100644 --- a/templates/repo/nav.tmpl +++ b/templates/repo/nav.tmpl @@ -27,6 +27,7 @@
-- cgit v1.2.3 From bf703ef61761fc4b09e3cb95672869520eccbc39 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Sun, 22 Jun 2014 14:10:12 +0800 Subject: add dashboard context switch button --- cmd/web.go | 2 +- public/css/gogs.css | 41 +++++++++++++++++++++++++++++++++++++++++ routers/dashboard.go | 2 +- templates/user/dashboard.tmpl | 14 ++++++++++++++ 4 files changed, 57 insertions(+), 2 deletions(-) (limited to 'public/css/gogs.css') diff --git a/cmd/web.go b/cmd/web.go index 2fdfe433..f62bc255 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -96,7 +96,7 @@ func runWeb(*cli.Context) { r.Get("/stars", user.Stars) }, reqSignIn) - m.Group("/api", func(r martini.Router) { + m.Group("/api", func(_ martini.Router) { m.Group("/v1", func(r martini.Router) { // Miscellaneous. r.Post("/markdown", bindIgnErr(apiv1.MarkdownForm{}), v1.Markdown) diff --git a/public/css/gogs.css b/public/css/gogs.css index 1e29eeba..67d1ebe5 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -638,6 +638,47 @@ html, body { margin: 0 .5em; } +#dashboard-switch .btn { + height: 40px; +} + +#dashboard-switch { + margin-top: 14px; + margin-right: 18px; +} + +#dashboard-switch .dropdown-menu { + padding: 0; +} + +#dashboard-switch-menu { + width: 180px; + margin-bottom: 0; + padding-bottom: 0; +} + +#dashboard-switch-menu > li > a { + display: block; + padding: .8em 1.2em; +} + +#dashboard-switch-menu > li { + border-bottom: 1px solid #eaeaea; +} + +#dashboard-switch-menu > li .fa { + opacity: 0; + margin-right: 16px; +} + +#dashboard-switch-menu > li.checked .fa { + opacity: 1; +} + +#dashboard-switch-menu > li:last-child { + border-bottom: none; +} + /* gogits repo single page */ #body-nav.repo-nav { diff --git a/routers/dashboard.go b/routers/dashboard.go index 438d0379..7daa0e7b 100644 --- a/routers/dashboard.go +++ b/routers/dashboard.go @@ -26,7 +26,7 @@ func Home(ctx *middleware.Context) { ctx.Data["PageIsHome"] = true - // Show recent updated repositoires for new visiters. + // Show recent updated repositories for new visitors. repos, err := models.GetRecentUpdatedRepositories() if err != nil { ctx.Handle(500, "dashboard.Home(GetRecentUpdatedRepositories)", err) diff --git a/templates/user/dashboard.tmpl b/templates/user/dashboard.tmpl index 5cda6722..c44ba362 100644 --- a/templates/user/dashboard.tmpl +++ b/templates/user/dashboard.tmpl @@ -2,6 +2,20 @@ {{template "base/navbar" .}}
+
+ + + +
-- cgit v1.2.3 From cc703ee6631e9a559fc3a72bf97d68c8fd5ebd10 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Wed, 25 Jun 2014 12:22:08 +0800 Subject: select owner when creating repository --- public/css/gogs.css | 7 +++++-- templates/repo/create.tmpl | 21 ++++++++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'public/css/gogs.css') diff --git a/public/css/gogs.css b/public/css/gogs.css index 1f465d84..960176f5 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -257,6 +257,9 @@ html, body { .card .btn { cursor: pointer; +} + +.card .btn-primary { margin-right: 1.2em; } @@ -638,7 +641,7 @@ html, body { margin: 0 .5em; } -#dashboard-switch .btn { +#dashboard-switch .btn, #repo-owner-switch .btn { height: 40px; } @@ -647,7 +650,7 @@ html, body { margin-right: 18px; } -#dashboard-switch .dropdown-menu { +#dashboard-switch .dropdown-menu,#repo-owner-switch .dropdown-menu { padding: 0; } diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 6da6a93d..0d1c42de 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -8,9 +8,28 @@
+
+ + + +
+
+ +
-- cgit v1.2.3 From b5ba2bd268b144ae0c878fe17257d8685d92f9cc Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Fri, 27 Jun 2014 21:33:49 +0800 Subject: add organization team-create page --- cmd/web.go | 3 ++ public/css/gogs.css | 2 +- routers/org/org.go | 4 --- routers/org/teams.go | 16 ++++++++++ templates/org/new_team.tmpl | 74 +++++++++++++++++++++++++++++++++++++++++++++ templates/org/teams.tmpl | 6 ++++ 6 files changed, 100 insertions(+), 5 deletions(-) create mode 100644 routers/org/teams.go create mode 100644 templates/org/new_team.tmpl (limited to 'public/css/gogs.css') diff --git a/cmd/web.go b/cmd/web.go index 729a1ba2..bf84d587 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 960176f5..eb95a1d0 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 4f57b9a9..c036a8e5 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 00000000..9585cb27 --- /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 00000000..752f37d2 --- /dev/null +++ b/templates/org/new_team.tmpl @@ -0,0 +1,74 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +
+
+
+ + +
+

Organization Name

+
+
+
+
+
+
+
+

Create new team

+
+ +
+ + You'll use this name to mention this team in conversations. +
+
+
+ +
+ +
+
+
+ +
+
+ +

This team will be able to view and clone its repositories.

+
+
+ +

This team will be able to read its repositories, as well as push to them.

+
+
+ +

This team will be able to push/pull to its repositories, as well as add other collaborators to them.

+
+
+
+
+
+ +
+ +
+
+
+
+
+{{template "base/footer" .}} diff --git a/templates/org/teams.tmpl b/templates/org/teams.tmpl index a8218812..90aab944 100644 --- a/templates/org/teams.tmpl +++ b/templates/org/teams.tmpl @@ -21,6 +21,12 @@
+
+
+ +
+
+

Team Name

-- cgit v1.2.3 From 1d55ecd29ce261cd3adf78649a44aaa30e4fd468 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Fri, 27 Jun 2014 22:04:04 +0800 Subject: add organization team-create page --- cmd/web.go | 3 +- public/css/gogs.css | 2 +- routers/org/teams.go | 5 +++ templates/org/edit_team.tmpl | 75 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 templates/org/edit_team.tmpl (limited to 'public/css/gogs.css') diff --git a/cmd/web.go b/cmd/web.go index bf84d587..1668fae2 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -195,7 +195,8 @@ func runWeb(*cli.Context) { 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/:team/edit", org.EditTeam) + r.Get("/:org/teams/new", org.NewTeam) r.Get("/:org/teams", org.Teams) r.Get("/:org/settings", org.Settings) diff --git a/public/css/gogs.css b/public/css/gogs.css index eb95a1d0..98cb5ee1 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -375,7 +375,7 @@ html, body { /* gogits repo create */ -#repo-create, #org-create, #org-teams-create { +#repo-create, #org-create, #org-teams-create, #org-teams-edit { width: 800px; } diff --git a/routers/org/teams.go b/routers/org/teams.go index 9585cb27..9ca5185a 100644 --- a/routers/org/teams.go +++ b/routers/org/teams.go @@ -14,3 +14,8 @@ func NewTeam(ctx *middleware.Context, params martini.Params) { ctx.Data["Title"] = "Organization "+params["org"]+" New Team" ctx.HTML(200, "org/new_team") } + +func EditTeam(ctx *middleware.Context, params martini.Params){ + ctx.Data["Title"] = "Organization "+params["org"]+" Edit Team" + ctx.HTML(200,"org/edit_team") +} diff --git a/templates/org/edit_team.tmpl b/templates/org/edit_team.tmpl new file mode 100644 index 00000000..4292575c --- /dev/null +++ b/templates/org/edit_team.tmpl @@ -0,0 +1,75 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +
+
+
+ + +
+

Organization Name

+
+
+
+
+
+
+
+

Edit team

+
+ +
+ + You'll use this name to mention this team in conversations. +
+
+
+ +
+ +
+
+
+ +
+
+ +

This team will be able to view and clone its repositories.

+
+
+ +

This team will be able to read its repositories, as well as push to them.

+
+
+ +

This team will be able to push/pull to its repositories, as well as add other collaborators to them.

+
+
+
+
+
+ +
+ + +
+
+
+
+
+{{template "base/footer" .}} -- cgit v1.2.3