2014-08-29 20:50:43 +08:00
|
|
|
package admin
|
|
|
|
|
|
|
|
|
|
import (
|
2022-11-05 23:33:05 +08:00
|
|
|
gocontext "context"
|
|
|
|
|
|
2021-05-19 13:38:13 +08:00
|
|
|
"gogs.io/gogs/internal/conf"
|
2019-10-24 01:51:46 -07:00
|
|
|
"gogs.io/gogs/internal/context"
|
2024-02-18 19:39:41 -05:00
|
|
|
"gogs.io/gogs/internal/database"
|
2019-10-24 01:51:46 -07:00
|
|
|
"gogs.io/gogs/internal/route"
|
2014-08-29 20:50:43 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
2017-04-05 09:17:21 -04:00
|
|
|
ORGS = "admin/org/list"
|
2014-08-29 20:50:43 +08:00
|
|
|
)
|
|
|
|
|
|
2017-06-03 07:26:09 -04:00
|
|
|
func Organizations(c *context.Context) {
|
|
|
|
|
c.Data["Title"] = c.Tr("admin.organizations")
|
|
|
|
|
c.Data["PageIsAdmin"] = true
|
|
|
|
|
c.Data["PageIsAdminOrganizations"] = true
|
2014-08-29 20:50:43 +08:00
|
|
|
|
2019-10-24 01:51:46 -07:00
|
|
|
route.RenderUserSearch(c, &route.UserSearchOptions{
|
2024-02-18 19:39:41 -05:00
|
|
|
Type: database.UserTypeOrganization,
|
2022-11-05 23:33:05 +08:00
|
|
|
Counter: func(gocontext.Context) int64 {
|
2024-02-18 19:39:41 -05:00
|
|
|
return database.CountOrganizations()
|
2022-11-05 23:33:05 +08:00
|
|
|
},
|
2024-02-18 19:39:41 -05:00
|
|
|
Ranger: func(_ gocontext.Context, page, pageSize int) ([]*database.User, error) {
|
|
|
|
|
return database.Organizations(page, pageSize)
|
2022-11-05 23:33:05 +08:00
|
|
|
},
|
2020-02-22 09:05:26 +08:00
|
|
|
PageSize: conf.UI.Admin.OrgPagingNum,
|
2016-03-15 14:23:12 -04:00
|
|
|
OrderBy: "id ASC",
|
|
|
|
|
TplName: ORGS,
|
|
|
|
|
})
|
2014-08-29 20:50:43 +08:00
|
|
|
}
|