|
|
@ -82,7 +82,7 @@ func MustAllowPulls(ctx *context.Context) { |
|
|
|
|
|
|
|
|
|
|
|
// RetrieveLabels find all the labels of a repository
|
|
|
|
// RetrieveLabels find all the labels of a repository
|
|
|
|
func RetrieveLabels(ctx *context.Context) { |
|
|
|
func RetrieveLabels(ctx *context.Context) { |
|
|
|
labels, err := models.GetLabelsByRepoID(ctx.Repo.Repository.ID) |
|
|
|
labels, err := models.GetLabelsByRepoID(ctx.Repo.Repository.ID, ctx.Query("sort")) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(500, "RetrieveLabels.GetLabels", err) |
|
|
|
ctx.Handle(500, "RetrieveLabels.GetLabels", err) |
|
|
|
return |
|
|
|
return |
|
|
@ -92,6 +92,7 @@ func RetrieveLabels(ctx *context.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
ctx.Data["Labels"] = labels |
|
|
|
ctx.Data["Labels"] = labels |
|
|
|
ctx.Data["NumLabels"] = len(labels) |
|
|
|
ctx.Data["NumLabels"] = len(labels) |
|
|
|
|
|
|
|
ctx.Data["SortType"] = ctx.Query("sort") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Issues render issues page
|
|
|
|
// Issues render issues page
|
|
|
@ -274,12 +275,12 @@ func renderAttachmentSettings(ctx *context.Context) { |
|
|
|
// RetrieveRepoMilestonesAndAssignees find all the milestones and assignees of a repository
|
|
|
|
// RetrieveRepoMilestonesAndAssignees find all the milestones and assignees of a repository
|
|
|
|
func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *models.Repository) { |
|
|
|
func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *models.Repository) { |
|
|
|
var err error |
|
|
|
var err error |
|
|
|
ctx.Data["OpenMilestones"], err = models.GetMilestones(repo.ID, -1, false) |
|
|
|
ctx.Data["OpenMilestones"], err = models.GetMilestones(repo.ID, -1, false, "") |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(500, "GetMilestones", err) |
|
|
|
ctx.Handle(500, "GetMilestones", err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
ctx.Data["ClosedMilestones"], err = models.GetMilestones(repo.ID, -1, true) |
|
|
|
ctx.Data["ClosedMilestones"], err = models.GetMilestones(repo.ID, -1, true, "") |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(500, "GetMilestones", err) |
|
|
|
ctx.Handle(500, "GetMilestones", err) |
|
|
|
return |
|
|
|
return |
|
|
@ -298,7 +299,7 @@ func RetrieveRepoMetas(ctx *context.Context, repo *models.Repository) []*models. |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
labels, err := models.GetLabelsByRepoID(repo.ID) |
|
|
|
labels, err := models.GetLabelsByRepoID(repo.ID, "") |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(500, "GetLabelsByRepoID", err) |
|
|
|
ctx.Handle(500, "GetLabelsByRepoID", err) |
|
|
|
return nil |
|
|
|
return nil |
|
|
@ -583,7 +584,7 @@ func ViewIssue(ctx *context.Context) { |
|
|
|
for i := range issue.Labels { |
|
|
|
for i := range issue.Labels { |
|
|
|
labelIDMark[issue.Labels[i].ID] = true |
|
|
|
labelIDMark[issue.Labels[i].ID] = true |
|
|
|
} |
|
|
|
} |
|
|
|
labels, err := models.GetLabelsByRepoID(repo.ID) |
|
|
|
labels, err := models.GetLabelsByRepoID(repo.ID, "") |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(500, "GetLabelsByRepoID", err) |
|
|
|
ctx.Handle(500, "GetLabelsByRepoID", err) |
|
|
|
return |
|
|
|
return |
|
|
@ -1079,6 +1080,7 @@ func Milestones(ctx *context.Context) { |
|
|
|
ctx.Data["OpenCount"] = openCount |
|
|
|
ctx.Data["OpenCount"] = openCount |
|
|
|
ctx.Data["ClosedCount"] = closedCount |
|
|
|
ctx.Data["ClosedCount"] = closedCount |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sortType := ctx.Query("sort") |
|
|
|
page := ctx.QueryInt("page") |
|
|
|
page := ctx.QueryInt("page") |
|
|
|
if page <= 1 { |
|
|
|
if page <= 1 { |
|
|
|
page = 1 |
|
|
|
page = 1 |
|
|
@ -1092,7 +1094,7 @@ func Milestones(ctx *context.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
ctx.Data["Page"] = paginater.New(total, setting.UI.IssuePagingNum, page, 5) |
|
|
|
ctx.Data["Page"] = paginater.New(total, setting.UI.IssuePagingNum, page, 5) |
|
|
|
|
|
|
|
|
|
|
|
miles, err := models.GetMilestones(ctx.Repo.Repository.ID, page, isShowClosed) |
|
|
|
miles, err := models.GetMilestones(ctx.Repo.Repository.ID, page, isShowClosed, sortType) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(500, "GetMilestones", err) |
|
|
|
ctx.Handle(500, "GetMilestones", err) |
|
|
|
return |
|
|
|
return |
|
|
@ -1108,6 +1110,7 @@ func Milestones(ctx *context.Context) { |
|
|
|
ctx.Data["State"] = "open" |
|
|
|
ctx.Data["State"] = "open" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ctx.Data["SortType"] = sortType |
|
|
|
ctx.Data["IsShowClosed"] = isShowClosed |
|
|
|
ctx.Data["IsShowClosed"] = isShowClosed |
|
|
|
ctx.HTML(200, tplMilestone) |
|
|
|
ctx.HTML(200, tplMilestone) |
|
|
|
} |
|
|
|
} |
|
|
|