diff options
author | Unknwon <u@gogs.io> | 2015-11-20 02:38:41 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-20 02:38:41 -0500 |
commit | 987dcc5372998adaafb68e00a9a460e955d018e5 (patch) | |
tree | 6f88db3bee30cab2339244c124e6c82324a597a1 /routers/repo/release.go | |
parent | 9b6c835715ab27aa7a008a51415f38ca2a856cd0 (diff) | |
download | gitea-987dcc5372998adaafb68e00a9a460e955d018e5.tar.gz gitea-987dcc5372998adaafb68e00a9a460e955d018e5.zip |
fix #1383
Diffstat (limited to 'routers/repo/release.go')
-rw-r--r-- | routers/repo/release.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/routers/repo/release.go b/routers/repo/release.go index f06a831918..8fc1cb7d37 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -27,9 +27,9 @@ func Releases(ctx *middleware.Context) { return } - rels, err := models.GetReleasesByRepoId(ctx.Repo.Repository.ID) + rels, err := models.GetReleasesByRepoID(ctx.Repo.Repository.ID) if err != nil { - ctx.Handle(500, "GetReleasesByRepoId", err) + ctx.Handle(500, "GetReleasesByRepoID", err) return } @@ -212,6 +212,7 @@ func EditRelease(ctx *middleware.Context) { } return } + ctx.Data["ID"] = rel.ID ctx.Data["tag_name"] = rel.TagName ctx.Data["tag_target"] = rel.Target ctx.Data["title"] = rel.Title @@ -257,3 +258,15 @@ func EditReleasePost(ctx *middleware.Context, form auth.EditReleaseForm) { } ctx.Redirect(ctx.Repo.RepoLink + "/releases") } + +func DeleteRelease(ctx *middleware.Context) { + if err := models.DeleteReleaseByID(ctx.QueryInt64("id")); err != nil { + ctx.Flash.Error("DeleteReleaseByID: " + err.Error()) + } else { + ctx.Flash.Success(ctx.Tr("repo.release.deletion_success")) + } + + ctx.JSON(200, map[string]interface{}{ + "redirect": ctx.Repo.RepoLink + "/releases", + }) +} |