Filter issues by assignee

This commit is contained in:
Unknwon 2015-08-15 11:24:41 +08:00
parent a24141ec9c
commit 4ce003dc15
7 changed files with 38 additions and 28 deletions

View file

@ -92,6 +92,7 @@ func Issues(ctx *middleware.Context) {
repo := ctx.Repo.Repository
selectLabels := ctx.Query("labels")
milestoneID := ctx.QueryInt64("milestone")
assigneeID = ctx.QueryInt64("assignee")
isShowClosed := ctx.Query("state") == "closed"
issueStats := models.GetIssueStats(repo.ID, uid, com.StrTo(selectLabels).MustInt64(), milestoneID, isShowClosed, filterMode)
@ -151,17 +152,24 @@ func Issues(ctx *middleware.Context) {
ctx.Data["Issues"] = issues
// Get milestones.
miles, err := models.GetAllRepoMilestones(repo.ID)
ctx.Data["Milestones"], err = models.GetAllRepoMilestones(repo.ID)
if err != nil {
ctx.Handle(500, "GetAllRepoMilestones: %v", err)
return
}
ctx.Data["Milestones"] = miles
// Get assignees.
ctx.Data["Assignees"], err = repo.GetAssignees()
if err != nil {
ctx.Handle(500, "GetAssignees: %v", err)
return
}
ctx.Data["IssueStats"] = issueStats
ctx.Data["SelectLabels"] = com.StrTo(selectLabels).MustInt64()
ctx.Data["ViewType"] = viewType
ctx.Data["MilestoneID"] = milestoneID
ctx.Data["AssigneeID"] = assigneeID
ctx.Data["IsShowClosed"] = isShowClosed
if isShowClosed {
ctx.Data["State"] = "closed"