summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-07-12 00:55:19 -0400
committerUnknown <joe2010xtmf@163.com>2014-07-12 00:55:19 -0400
commit0f907301b7fbd05faf07bc22b3316ae1093c6724 (patch)
tree806e40ea6ef651e28563d09526377ed736528c10 /routers
parent63cc14062a891a99a429f2eef0ee90a3f5795f47 (diff)
downloadgitea-0f907301b7fbd05faf07bc22b3316ae1093c6724.tar.gz
gitea-0f907301b7fbd05faf07bc22b3316ae1093c6724.zip
Fix #285
Diffstat (limited to 'routers')
-rw-r--r--routers/admin/admin.go4
-rw-r--r--routers/api/v1/repositories.go13
-rw-r--r--routers/api/v1/users.go2
-rw-r--r--routers/user/setting.go8
4 files changed, 20 insertions, 7 deletions
diff --git a/routers/admin/admin.go b/routers/admin/admin.go
index 2a40792a18..eb4123435a 100644
--- a/routers/admin/admin.go
+++ b/routers/admin/admin.go
@@ -163,7 +163,7 @@ func Users(ctx *middleware.Context) {
if p < 1 {
p = 1
}
- pageNum := 100
+ pageNum := 50
count := models.CountUsers()
curCount := int64((p-1)*pageNum + pageNum)
if curCount > count {
@@ -192,7 +192,7 @@ func Repositories(ctx *middleware.Context) {
if p < 1 {
p = 1
}
- pageNum := 2
+ pageNum := 50
count := models.CountRepositories()
curCount := int64((p-1)*pageNum + pageNum)
if curCount > count {
diff --git a/routers/api/v1/repositories.go b/routers/api/v1/repositories.go
new file mode 100644
index 0000000000..11c8b6b2e3
--- /dev/null
+++ b/routers/api/v1/repositories.go
@@ -0,0 +1,13 @@
+// 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.
+
+package v1
+
+import (
+ "github.com/gogits/gogs/modules/middleware"
+)
+
+func SearchOrgRepositoreis(ctx *middleware.Context) {
+
+}
diff --git a/routers/api/v1/users.go b/routers/api/v1/users.go
index a5ad8fbca0..e4da60aa7b 100644
--- a/routers/api/v1/users.go
+++ b/routers/api/v1/users.go
@@ -15,7 +15,7 @@ type user struct {
AvatarLink string `json:"avatar"`
}
-func SearchUser(ctx *middleware.Context) {
+func SearchUsers(ctx *middleware.Context) {
q := ctx.Query("q")
limit, err := base.StrTo(ctx.Query("limit")).Int()
if err != nil {
diff --git a/routers/user/setting.go b/routers/user/setting.go
index 8e4b0840c7..3ff8e21df3 100644
--- a/routers/user/setting.go
+++ b/routers/user/setting.go
@@ -47,13 +47,13 @@ func SettingPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
if ctx.User.Name != form.UserName {
isExist, err := models.IsUserExist(form.UserName)
if err != nil {
- ctx.Handle(500, "user.Setting(update: check existence)", err)
+ ctx.Handle(500, "user.SettingPost(update: check existence)", err)
return
} else if isExist {
- ctx.RenderWithErr("User name has been taken.", "user/setting", &form)
+ ctx.RenderWithErr("User name has been taken.", SETTING, &form)
return
} else if err = models.ChangeUserName(ctx.User, form.UserName); err != nil {
- ctx.Handle(500, "user.Setting(change user name)", err)
+ ctx.Handle(500, "user.SettingPost(change user name)", err)
return
}
log.Trace("%s User name changed: %s -> %s", ctx.Req.RequestURI, ctx.User.Name, form.UserName)
@@ -68,7 +68,7 @@ func SettingPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
ctx.User.Avatar = base.EncodeMd5(form.Avatar)
ctx.User.AvatarEmail = form.Avatar
if err := models.UpdateUser(ctx.User); err != nil {
- ctx.Handle(500, "setting.Setting(UpdateUser)", err)
+ ctx.Handle(500, "setting.SettingPost(UpdateUser)", err)
return
}
log.Trace("%s User setting updated: %s", ctx.Req.RequestURI, ctx.User.LowerName)