Use struct for UI settings
This commit is contained in:
parent
256cd6374a
commit
46e96c008c
16 changed files with 48 additions and 48 deletions
|
@ -29,9 +29,9 @@ func Notices(ctx *context.Context) {
|
|||
if page <= 1 {
|
||||
page = 1
|
||||
}
|
||||
ctx.Data["Page"] = paginater.New(int(total), setting.AdminNoticePagingNum, page, 5)
|
||||
ctx.Data["Page"] = paginater.New(int(total), setting.UI.Admin.NoticePagingNum, page, 5)
|
||||
|
||||
notices, err := models.Notices(page, setting.AdminNoticePagingNum)
|
||||
notices, err := models.Notices(page, setting.UI.Admin.NoticePagingNum)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "Notices", err)
|
||||
return
|
||||
|
|
|
@ -25,7 +25,7 @@ func Organizations(ctx *context.Context) {
|
|||
Type: models.USER_TYPE_ORGANIZATION,
|
||||
Counter: models.CountOrganizations,
|
||||
Ranger: models.Organizations,
|
||||
PageSize: setting.AdminOrgPagingNum,
|
||||
PageSize: setting.UI.Admin.OrgPagingNum,
|
||||
OrderBy: "id ASC",
|
||||
TplName: ORGS,
|
||||
})
|
||||
|
|
|
@ -26,7 +26,7 @@ func Repos(ctx *context.Context) {
|
|||
Counter: models.CountRepositories,
|
||||
Ranger: models.Repositories,
|
||||
Private: true,
|
||||
PageSize: setting.AdminRepoPagingNum,
|
||||
PageSize: setting.UI.Admin.RepoPagingNum,
|
||||
OrderBy: "id ASC",
|
||||
TplName: REPOS,
|
||||
})
|
||||
|
|
|
@ -33,7 +33,7 @@ func Users(ctx *context.Context) {
|
|||
Type: models.USER_TYPE_INDIVIDUAL,
|
||||
Counter: models.CountUsers,
|
||||
Ranger: models.Users,
|
||||
PageSize: setting.AdminUserPagingNum,
|
||||
PageSize: setting.UI.Admin.UserPagingNum,
|
||||
OrderBy: "id ASC",
|
||||
TplName: USERS,
|
||||
})
|
||||
|
|
|
@ -31,7 +31,7 @@ func ListIssues(ctx *context.APIContext) {
|
|||
apiIssues[i] = convert.ToIssue(issues[i])
|
||||
}
|
||||
|
||||
ctx.SetLinkHeader(ctx.Repo.Repository.NumIssues, setting.IssuePagingNum)
|
||||
ctx.SetLinkHeader(ctx.Repo.Repository.NumIssues, setting.UI.IssuePagingNum)
|
||||
ctx.JSON(200, &apiIssues)
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ func ExploreRepos(ctx *context.Context) {
|
|||
RenderRepoSearch(ctx, &RepoSearchOptions{
|
||||
Counter: models.CountPublicRepositories,
|
||||
Ranger: models.GetRecentUpdatedRepositories,
|
||||
PageSize: setting.ExplorePagingNum,
|
||||
PageSize: setting.UI.ExplorePagingNum,
|
||||
OrderBy: "updated_unix DESC",
|
||||
TplName: EXPLORE_REPOS,
|
||||
})
|
||||
|
@ -174,7 +174,7 @@ func ExploreUsers(ctx *context.Context) {
|
|||
Type: models.USER_TYPE_INDIVIDUAL,
|
||||
Counter: models.CountUsers,
|
||||
Ranger: models.Users,
|
||||
PageSize: setting.ExplorePagingNum,
|
||||
PageSize: setting.UI.ExplorePagingNum,
|
||||
OrderBy: "updated_unix DESC",
|
||||
TplName: EXPLORE_USERS,
|
||||
})
|
||||
|
|
|
@ -163,7 +163,7 @@ func Issues(ctx *context.Context) {
|
|||
} else {
|
||||
total = int(issueStats.ClosedCount)
|
||||
}
|
||||
pager := paginater.New(total, setting.IssuePagingNum, page, 5)
|
||||
pager := paginater.New(total, setting.UI.IssuePagingNum, page, 5)
|
||||
ctx.Data["Page"] = pager
|
||||
|
||||
// Get issues.
|
||||
|
@ -1017,7 +1017,7 @@ func Milestones(ctx *context.Context) {
|
|||
} else {
|
||||
total = int(closedCount)
|
||||
}
|
||||
ctx.Data["Page"] = paginater.New(total, setting.IssuePagingNum, page, 5)
|
||||
ctx.Data["Page"] = paginater.New(total, setting.UI.IssuePagingNum, page, 5)
|
||||
|
||||
miles, err := models.GetMilestones(ctx.Repo.Repository.ID, page, isShowClosed)
|
||||
if err != nil {
|
||||
|
|
|
@ -105,7 +105,7 @@ func Home(ctx *context.Context) {
|
|||
case isImageFile:
|
||||
ctx.Data["IsImageFile"] = true
|
||||
case isTextFile:
|
||||
if blob.Size() >= setting.MaxDisplayFileSize {
|
||||
if blob.Size() >= setting.UI.MaxDisplayFileSize {
|
||||
ctx.Data["IsFileTooLarge"] = true
|
||||
} else {
|
||||
ctx.Data["IsFileTooLarge"] = false
|
||||
|
|
|
@ -253,7 +253,7 @@ func Issues(ctx *context.Context) {
|
|||
} else {
|
||||
total = int(issueStats.ClosedCount)
|
||||
}
|
||||
ctx.Data["Page"] = paginater.New(total, setting.IssuePagingNum, page, 5)
|
||||
ctx.Data["Page"] = paginater.New(total, setting.UI.IssuePagingNum, page, 5)
|
||||
|
||||
// Get issues.
|
||||
issues, err := models.Issues(&models.IssuesOptions{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue