mirror of
https://github.com/go-gitea/gitea
synced 2025-07-25 19:58:36 +00:00
Kanban board (#8346)
Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: jaqra <48099350+jaqra@users.noreply.github.com> Co-authored-by: Kerry <flatline-studios@users.noreply.github.com> Co-authored-by: Jaqra <jaqra@hotmail.com> Co-authored-by: Kyle Evans <kevans91@users.noreply.github.com> Co-authored-by: Tsakiridis Ilias <TsakiDev@users.noreply.github.com> Co-authored-by: Ilias Tsakiridis <ilias.tsakiridis@outlook.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
@@ -207,39 +207,28 @@ func EditMilestonePost(ctx *context.Context, form auth.CreateMilestoneForm) {
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/milestones")
|
||||
}
|
||||
|
||||
// ChangeMilestonStatus response for change a milestone's status
|
||||
func ChangeMilestonStatus(ctx *context.Context) {
|
||||
m, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
|
||||
if err != nil {
|
||||
if models.IsErrMilestoneNotExist(err) {
|
||||
ctx.NotFound("", err)
|
||||
} else {
|
||||
ctx.ServerError("GetMilestoneByRepoID", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ChangeMilestoneStatus response for change a milestone's status
|
||||
func ChangeMilestoneStatus(ctx *context.Context) {
|
||||
toClose := false
|
||||
switch ctx.Params(":action") {
|
||||
case "open":
|
||||
if m.IsClosed {
|
||||
if err = models.ChangeMilestoneStatus(m, false); err != nil {
|
||||
ctx.ServerError("ChangeMilestoneStatus", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/milestones?state=open")
|
||||
toClose = false
|
||||
case "close":
|
||||
if !m.IsClosed {
|
||||
m.ClosedDateUnix = timeutil.TimeStampNow()
|
||||
if err = models.ChangeMilestoneStatus(m, true); err != nil {
|
||||
ctx.ServerError("ChangeMilestoneStatus", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/milestones?state=closed")
|
||||
toClose = true
|
||||
default:
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/milestones")
|
||||
}
|
||||
id := ctx.ParamsInt64(":id")
|
||||
|
||||
if err := models.ChangeMilestoneStatusByRepoIDAndID(ctx.Repo.Repository.ID, id, toClose); err != nil {
|
||||
if models.IsErrMilestoneNotExist(err) {
|
||||
ctx.NotFound("", err)
|
||||
} else {
|
||||
ctx.ServerError("ChangeMilestoneStatusByIDAndRepoID", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/milestones?state=" + ctx.Params(":action"))
|
||||
}
|
||||
|
||||
// DeleteMilestone delete a milestone
|
||||
@@ -274,7 +263,7 @@ func MilestoneIssuesAndPulls(ctx *context.Context) {
|
||||
ctx.Data["Title"] = milestone.Name
|
||||
ctx.Data["Milestone"] = milestone
|
||||
|
||||
issues(ctx, milestoneID, util.OptionalBoolNone)
|
||||
issues(ctx, milestoneID, 0, util.OptionalBoolNone)
|
||||
|
||||
ctx.Data["CanWriteIssues"] = ctx.Repo.CanWriteIssuesOrPulls(false)
|
||||
ctx.Data["CanWritePulls"] = ctx.Repo.CanWriteIssuesOrPulls(true)
|
||||
|
Reference in New Issue
Block a user