From 7463d9c51dca6740af0cbb6c7cbeee17a99ecdf6 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Mon, 30 Jan 2017 13:21:24 -0500 Subject: [PATCH] Fix can not save release draft as draft again (#3669) But release was not saved as draft in the first time, is not possible to be draft afterwards because the Git tag was created. --- gogs.go | 2 +- routers/repo/release.go | 2 ++ templates/.VERSION | 2 +- templates/repo/release/new.tmpl | 17 ++++++++++++----- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/gogs.go b/gogs.go index 3eb1731e4..fd7397427 100644 --- a/gogs.go +++ b/gogs.go @@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.9.127.0130" +const APP_VER = "0.9.128.0130" func init() { setting.AppVer = APP_VER diff --git a/routers/repo/release.go b/routers/repo/release.go index 0abd97fad..661aa4e22 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -240,6 +240,7 @@ func EditRelease(ctx *context.Context) { ctx.Data["title"] = rel.Title ctx.Data["content"] = rel.Note ctx.Data["prerelease"] = rel.IsPrerelease + ctx.Data["IsDraft"] = rel.IsDraft ctx.HTML(200, RELEASE_NEW) } @@ -264,6 +265,7 @@ func EditReleasePost(ctx *context.Context, form auth.EditReleaseForm) { ctx.Data["title"] = rel.Title ctx.Data["content"] = rel.Note ctx.Data["prerelease"] = rel.IsPrerelease + ctx.Data["IsDraft"] = rel.IsDraft if ctx.HasError() { ctx.HTML(200, RELEASE_NEW) diff --git a/templates/.VERSION b/templates/.VERSION index f82f38aa2..e499a1cf3 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.127.0130 \ No newline at end of file +0.9.128.0130 \ No newline at end of file diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl index 9f947fa26..237e1067c 100644 --- a/templates/repo/release/new.tmpl +++ b/templates/repo/release/new.tmpl @@ -60,12 +60,20 @@ {{.i18n.Tr "repo.release.prerelease_helper"}}
+ + {{.i18n.Tr "repo.release.cancel"}} + + {{/* Release didn't save as draft at first time is not possible to be draft again because the Git tag had been created. */}} + {{if or (not .PageIsEditRelease) .IsDraft}} + + {{end}} {{if .PageIsEditRelease}} - - {{.i18n.Tr "repo.release.cancel"}} - {{$.i18n.Tr "repo.release.delete_release"}} @@ -74,7 +82,6 @@ - {{end}}