summaryrefslogtreecommitdiffstats
path: root/routers/web/repo
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo')
-rw-r--r--routers/web/repo/issue.go12
-rw-r--r--routers/web/repo/milestone.go13
-rw-r--r--routers/web/repo/setting.go4
-rw-r--r--routers/web/repo/view.go2
-rw-r--r--routers/web/repo/webhook.go2
5 files changed, 14 insertions, 19 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go
index 6050bb5c23..ff83be4410 100644
--- a/routers/web/repo/issue.go
+++ b/routers/web/repo/issue.go
@@ -378,7 +378,7 @@ func Issues(ctx *context.Context) {
var err error
// Get milestones
- ctx.Data["Milestones"], err = models.GetMilestones(models.GetMilestonesOption{
+ ctx.Data["Milestones"], _, err = models.GetMilestones(models.GetMilestonesOption{
RepoID: ctx.Repo.Repository.ID,
State: api.StateType(ctx.FormString("state")),
})
@@ -395,7 +395,7 @@ func Issues(ctx *context.Context) {
// RetrieveRepoMilestonesAndAssignees find all the milestones and assignees of a repository
func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *models.Repository) {
var err error
- ctx.Data["OpenMilestones"], err = models.GetMilestones(models.GetMilestonesOption{
+ ctx.Data["OpenMilestones"], _, err = models.GetMilestones(models.GetMilestonesOption{
RepoID: repo.ID,
State: api.StateOpen,
})
@@ -403,7 +403,7 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *models.Repos
ctx.ServerError("GetMilestones", err)
return
}
- ctx.Data["ClosedMilestones"], err = models.GetMilestones(models.GetMilestonesOption{
+ ctx.Data["ClosedMilestones"], _, err = models.GetMilestones(models.GetMilestonesOption{
RepoID: repo.ID,
State: api.StateClosed,
})
@@ -1265,7 +1265,7 @@ func ViewIssue(ctx *context.Context) {
} else {
ctx.Data["CanUseTimetracker"] = false
}
- if ctx.Data["WorkingUsers"], err = models.TotalTimes(models.FindTrackedTimesOptions{IssueID: issue.ID}); err != nil {
+ if ctx.Data["WorkingUsers"], err = models.TotalTimes(&models.FindTrackedTimesOptions{IssueID: issue.ID}); err != nil {
ctx.ServerError("TotalTimes", err)
return
}
@@ -2584,8 +2584,8 @@ func handleTeamMentions(ctx *context.Context) {
}
if isAdmin {
- if err := ctx.Repo.Owner.GetTeams(&models.SearchTeamOptions{}); err != nil {
- ctx.ServerError("GetTeams", err)
+ if err := ctx.Repo.Owner.LoadTeams(); err != nil {
+ ctx.ServerError("LoadTeams", err)
return
}
} else {
diff --git a/routers/web/repo/milestone.go b/routers/web/repo/milestone.go
index ca77e0976e..3ba27dd19a 100644
--- a/routers/web/repo/milestone.go
+++ b/routers/web/repo/milestone.go
@@ -53,17 +53,12 @@ func Milestones(ctx *context.Context) {
page = 1
}
- var total int
- var state structs.StateType
- if !isShowClosed {
- total = int(stats.OpenCount)
- state = structs.StateOpen
- } else {
- total = int(stats.ClosedCount)
+ state := structs.StateOpen
+ if isShowClosed {
state = structs.StateClosed
}
- miles, err := models.GetMilestones(models.GetMilestonesOption{
+ miles, total, err := models.GetMilestones(models.GetMilestonesOption{
ListOptions: models.ListOptions{
Page: page,
PageSize: setting.UI.IssuePagingNum,
@@ -106,7 +101,7 @@ func Milestones(ctx *context.Context) {
ctx.Data["Keyword"] = keyword
ctx.Data["IsShowClosed"] = isShowClosed
- pager := context.NewPagination(total, setting.UI.IssuePagingNum, page, 5)
+ pager := context.NewPagination(int(total), setting.UI.IssuePagingNum, page, 5)
pager.AddParam(ctx, "state", "State")
pager.AddParam(ctx, "q", "Keyword")
ctx.Data["Page"] = pager
diff --git a/routers/web/repo/setting.go b/routers/web/repo/setting.go
index 2f15610737..20253a7cae 100644
--- a/routers/web/repo/setting.go
+++ b/routers/web/repo/setting.go
@@ -1002,7 +1002,7 @@ func DeployKeys(ctx *context.Context) {
ctx.Data["PageIsSettingsKeys"] = true
ctx.Data["DisableSSH"] = setting.SSH.Disabled
- keys, err := models.ListDeployKeys(ctx.Repo.Repository.ID, models.ListOptions{})
+ keys, err := models.ListDeployKeys(&models.ListDeployKeysOptions{RepoID: ctx.Repo.Repository.ID})
if err != nil {
ctx.ServerError("ListDeployKeys", err)
return
@@ -1018,7 +1018,7 @@ func DeployKeysPost(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings.deploy_keys")
ctx.Data["PageIsSettingsKeys"] = true
- keys, err := models.ListDeployKeys(ctx.Repo.Repository.ID, models.ListOptions{})
+ keys, err := models.ListDeployKeys(&models.ListDeployKeysOptions{RepoID: ctx.Repo.Repository.ID})
if err != nil {
ctx.ServerError("ListDeployKeys", err)
return
diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go
index 6c8645226f..2c703fc1af 100644
--- a/routers/web/repo/view.go
+++ b/routers/web/repo/view.go
@@ -674,7 +674,7 @@ func renderLanguageStats(ctx *context.Context) {
}
func renderRepoTopics(ctx *context.Context) {
- topics, err := models.FindTopics(&models.FindTopicOptions{
+ topics, _, err := models.FindTopics(&models.FindTopicOptions{
RepoID: ctx.Repo.Repository.ID,
})
if err != nil {
diff --git a/routers/web/repo/webhook.go b/routers/web/repo/webhook.go
index 79f47470f2..0ceb9bc1dc 100644
--- a/routers/web/repo/webhook.go
+++ b/routers/web/repo/webhook.go
@@ -41,7 +41,7 @@ func Webhooks(ctx *context.Context) {
ctx.Data["BaseLinkNew"] = ctx.Repo.RepoLink + "/settings/hooks"
ctx.Data["Description"] = ctx.Tr("repo.settings.hooks_desc", "https://docs.gitea.io/en-us/webhooks/")
- ws, err := models.GetWebhooksByRepoID(ctx.Repo.Repository.ID, models.ListOptions{})
+ ws, err := models.ListWebhooksByOpts(&models.ListWebhookOptions{RepoID: ctx.Repo.Repository.ID})
if err != nil {
ctx.ServerError("GetWebhooksByRepoID", err)
return