#2156 admin able to edit organization max repo creation

This commit is contained in:
Unknwon 2015-12-11 19:24:57 -05:00
parent 76bdbcc969
commit 59c965a5ec
12 changed files with 30 additions and 18 deletions

View File

@ -5,7 +5,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) ![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
##### Current version: 0.7.43 Beta ##### Current version: 0.7.44 Beta
| Web | UI | Preview | | Web | UI | Preview |
|:-------------:|:-------:|:-------:| |:-------------:|:-------:|:-------:|

View File

@ -258,10 +258,8 @@ func runWeb(ctx *cli.Context) {
m.Group("/users", func() { m.Group("/users", func() {
m.Get("", admin.Users) m.Get("", admin.Users)
m.Get("/new", admin.NewUser) m.Combo("/new").Get(admin.NewUser).Post(bindIgnErr(auth.AdminCrateUserForm{}), admin.NewUserPost)
m.Post("/new", bindIgnErr(auth.AdminCrateUserForm{}), admin.NewUserPost) m.Combo("/:userid").Get(admin.EditUser).Post(bindIgnErr(auth.AdminEditUserForm{}), admin.EditUserPost)
m.Get("/:userid", admin.EditUser)
m.Post("/:userid", bindIgnErr(auth.AdminEditUserForm{}), admin.EditUserPost)
m.Post("/:userid/delete", admin.DeleteUser) m.Post("/:userid/delete", admin.DeleteUser)
}) })
@ -276,8 +274,7 @@ func runWeb(ctx *cli.Context) {
m.Group("/auths", func() { m.Group("/auths", func() {
m.Get("", admin.Authentications) m.Get("", admin.Authentications)
m.Get("/new", admin.NewAuthSource) m.Combo("/new").Get(admin.NewAuthSource).Post(bindIgnErr(auth.AuthenticationForm{}), admin.NewAuthSourcePost)
m.Post("/new", bindIgnErr(auth.AuthenticationForm{}), admin.NewAuthSourcePost)
m.Combo("/:authid").Get(admin.EditAuthSource). m.Combo("/:authid").Get(admin.EditAuthSource).
Post(bindIgnErr(auth.AuthenticationForm{}), admin.EditAuthSourcePost) Post(bindIgnErr(auth.AuthenticationForm{}), admin.EditAuthSourcePost)
m.Post("/:authid/delete", admin.DeleteAuthSource) m.Post("/:authid/delete", admin.DeleteAuthSource)

View File

@ -18,7 +18,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.7.43.1211 Beta" const APP_VER = "0.7.44.1211 Beta"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

View File

@ -25,11 +25,12 @@ func (f *CreateOrgForm) Validate(ctx *macaron.Context, errs binding.Errors) bind
} }
type UpdateOrgSettingForm struct { type UpdateOrgSettingForm struct {
Name string `binding:"Required;AlphaDashDot;MaxSize(35)" locale:"org.org_name_holder"` Name string `binding:"Required;AlphaDashDot;MaxSize(35)" locale:"org.org_name_holder"`
FullName string `binding:"MaxSize(100)"` FullName string `binding:"MaxSize(100)"`
Description string `binding:"MaxSize(255)"` Description string `binding:"MaxSize(255)"`
Website string `binding:"Url;MaxSize(100)"` Website string `binding:"Url;MaxSize(100)"`
Location string `binding:"MaxSize(50)"` Location string `binding:"MaxSize(50)"`
MaxRepoCreation int
} }
func (f *UpdateOrgSettingForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { func (f *UpdateOrgSettingForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {

View File

@ -4379,7 +4379,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 48293, mode: os.FileMode(420), modTime: time.Unix(1449865728, 0)} info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 48293, mode: os.FileMode(420), modTime: time.Unix(1449879514, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }

View File

@ -2773,7 +2773,6 @@ footer .container .links > *:first-child {
width: 50%!important; width: 50%!important;
} }
.organization.options input { .organization.options input {
width: 50%!important;
min-width: 300px; min-width: 300px;
} }
.organization.profile #org-avatar { .organization.profile #org-avatar {

View File

@ -21,7 +21,6 @@
&.options { &.options {
input { input {
width: 50%!important;
min-width: 300px; min-width: 300px;
} }
} }

View File

@ -66,6 +66,10 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateOrgSettingForm) {
org.Name = form.Name org.Name = form.Name
org.LowerName = strings.ToLower(form.Name) org.LowerName = strings.ToLower(form.Name)
if ctx.User.IsAdmin {
org.MaxRepoCreation = form.MaxRepoCreation
}
org.FullName = form.FullName org.FullName = form.FullName
org.Description = form.Description org.Description = form.Description
org.Website = form.Website org.Website = form.Website

View File

@ -1 +1 @@
0.7.43.1211 Beta 0.7.44.1211 Beta

View File

@ -92,6 +92,8 @@
</div> </div>
</div> </div>
<div class="ui divider"></div>
<div class="field"> <div class="field">
<button class="ui green button">{{.i18n.Tr "admin.users.update_profile"}}</button> <button class="ui green button">{{.i18n.Tr "admin.users.update_profile"}}</button>
<div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.User.Id}}">{{.i18n.Tr "admin.users.delete_account"}}</div> <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.User.Id}}">{{.i18n.Tr "admin.users.delete_account"}}</div>

View File

@ -35,7 +35,7 @@
<td><i class="fa fa{{if .IsAdmin}}-check{{end}}-square-o"></i></td> <td><i class="fa fa{{if .IsAdmin}}-check{{end}}-square-o"></i></td>
<td>{{.NumRepos}}</td> <td>{{.NumRepos}}</td>
<td><span title="{{DateFmtLong .Created}}">{{DateFmtShort .Created }}</span></td> <td><span title="{{DateFmtLong .Created}}">{{DateFmtShort .Created }}</span></td>
<td><a href="{{AppSubUrl}}/admin/users/{{.Id}}"><i class="fa fa-pencil-square-o"></i></a></td> <td><a href="{{$.Link}}/{{.Id}}"><i class="fa fa-pencil-square-o"></i></a></td>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>

View File

@ -33,6 +33,16 @@
<input id="location" name="location" value="{{.Org.Location}}"> <input id="location" name="location" value="{{.Org.Location}}">
</div> </div>
{{if .SignedUser.IsAdmin}}
<div class="ui divider"></div>
<div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}">
<label for="max_repo_creation">{{.i18n.Tr "admin.users.max_repo_creation"}}</label>
<input id="max_repo_creation" name="max_repo_creation" type="number" value="{{.Org.MaxRepoCreation}}">
<p class="help">{{.i18n.Tr "admin.users.max_repo_creation_desc"}}</p>
</div>
{{end}}
<div class="field"> <div class="field">
<button class="ui green button">{{$.i18n.Tr "org.settings.update_settings"}}</button> <button class="ui green button">{{$.i18n.Tr "org.settings.update_settings"}}</button>
</div> </div>