diff options
-rw-r--r-- | routers/repo/release.go | 1 | ||||
-rw-r--r-- | templates/repo/release/new.tmpl | 13 |
2 files changed, 11 insertions, 3 deletions
diff --git a/routers/repo/release.go b/routers/repo/release.go index 3c49663830..187952c2e6 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -247,6 +247,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) } diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl index 9f947fa26a..3a9e6fadd8 100644 --- a/templates/repo/release/new.tmpl +++ b/templates/repo/release/new.tmpl @@ -64,9 +64,16 @@ <a class="ui blue basic button" href="{{.RepoLink}}/releases"> {{.i18n.Tr "repo.release.cancel"}} </a> - <button class="ui green button"> - {{.i18n.Tr "repo.release.edit_release"}} - </button> + {{if .IsDraft}} + <input class="ui grey button" type="submit" name="draft" value="{{.i18n.Tr "repo.release.save_draft"}}"/> + <button class="ui green button"> + {{.i18n.Tr "repo.release.publish"}} + </button> + {{else}} + <button class="ui green button"> + {{.i18n.Tr "repo.release.edit_release"}} + </button> + {{end}} <a class="ui red button delete-button" data-url="{{$.RepoLink}}/releases/delete" data-id="{{.ID}}"> {{$.i18n.Tr "repo.release.delete_release"}} </a> |