diff options
author | Antoine GIRARD <sapk@sapk.fr> | 2015-09-25 19:54:52 +0200 |
---|---|---|
committer | Antoine GIRARD <sapk@sapk.fr> | 2015-09-25 19:54:52 +0200 |
commit | c98dad1cf3b068f6bbb52a9cd791f2bd180731f2 (patch) | |
tree | b1a704b73a3ceb63f4acec986df9002ffc0b7c0b /models/org.go | |
parent | 1c35380c2c476e8eb5022078262e8cadade4d4c7 (diff) | |
download | gitea-c98dad1cf3b068f6bbb52a9cd791f2bd180731f2.tar.gz gitea-c98dad1cf3b068f6bbb52a9cd791f2bd180731f2.zip |
New admin organization UI
Diffstat (limited to 'models/org.go')
-rw-r--r-- | models/org.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/models/org.go b/models/org.go index b45dcafb21..5c3b0d12a1 100644 --- a/models/org.go +++ b/models/org.go @@ -184,11 +184,10 @@ func CountOrganizations() int64 { return count } -// GetOrganizations returns given number of organizations with offset. -func GetOrganizations(num, offset int) ([]*User, error) { - orgs := make([]*User, 0, num) - err := x.Limit(num, offset).Where("type=1").Asc("id").Find(&orgs) - return orgs, err +// Organizations returns number of organizations in given page. +func Organizations(page, pageSize int) ([]*User, error) { + orgs := make([]*User, 0, pageSize) + return orgs, x.Limit(pageSize, (page-1)*pageSize).Where("type=1").Asc("id").Find(&orgs) } // DeleteOrganization completely and permanently deletes everything of organization. |