issue.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. }
  24. func CreateIssue(ctx *middleware.Context, params martini.Params) {
  25. if !ctx.Repo.IsOwner {
  26. ctx.Error(404)
  27. return
  28. }
  29. // else if err = models.CreateIssue(userId, repoId, milestoneId, assigneeId, name, labels, mentions, content, isPull); err != nil {
  30. // }
  31. }