issue.go 842 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package repo
  5. import (
  6. "github.com/codegangsta/martini"
  7. "github.com/gogits/gogs/models"
  8. "github.com/gogits/gogs/modules/base"
  9. "github.com/gogits/gogs/modules/middleware"
  10. )
  11. func Issues(ctx *middleware.Context, params martini.Params) {
  12. ctx.Data["IsRepoToolbarIssues"] = true
  13. milestoneId, _ := base.StrTo(params["milestone"]).Int()
  14. page, _ := base.StrTo(params["page"]).Int()
  15. var err error
  16. ctx.Data["Issues"], err = models.GetIssues(0, ctx.Repo.Repository.Id, 0,
  17. int64(milestoneId), page, params["state"] == "closed", false, params["labels"], params["sortType"])
  18. if err != nil {
  19. ctx.Handle(200, "issue.Issues: %v", err)
  20. return
  21. }
  22. ctx.HTML(200, "repo/issues")
  23. }