Allow updating draft releases while keeping them as draft

Closes #162
This commit is contained in:
Sandro Santilli 2016-11-14 17:30:22 +01:00
parent 81f227eace
commit cd339263d9
2 changed files with 11 additions and 3 deletions

View file

@ -247,6 +247,7 @@ func EditRelease(ctx *context.Context) {
ctx.Data["title"] = rel.Title ctx.Data["title"] = rel.Title
ctx.Data["content"] = rel.Note ctx.Data["content"] = rel.Note
ctx.Data["prerelease"] = rel.IsPrerelease ctx.Data["prerelease"] = rel.IsPrerelease
ctx.Data["IsDraft"] = rel.IsDraft
ctx.HTML(200, RELEASE_NEW) ctx.HTML(200, RELEASE_NEW)
} }

View file

@ -64,9 +64,16 @@
<a class="ui blue basic button" href="{{.RepoLink}}/releases"> <a class="ui blue basic button" href="{{.RepoLink}}/releases">
{{.i18n.Tr "repo.release.cancel"}} {{.i18n.Tr "repo.release.cancel"}}
</a> </a>
{{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"> <button class="ui green button">
{{.i18n.Tr "repo.release.edit_release"}} {{.i18n.Tr "repo.release.edit_release"}}
</button> </button>
{{end}}
<a class="ui red button delete-button" data-url="{{$.RepoLink}}/releases/delete" data-id="{{.ID}}"> <a class="ui red button delete-button" data-url="{{$.RepoLink}}/releases/delete" data-id="{{.ID}}">
{{$.i18n.Tr "repo.release.delete_release"}} {{$.i18n.Tr "repo.release.delete_release"}}
</a> </a>