Skip to content

Commit

Permalink
Merge pull request #169 from strk/allow-update-draft-releases
Browse files Browse the repository at this point in the history
Allow updating draft releases while keeping them as draft
  • Loading branch information
bkcsoft authored Nov 14, 2016
2 parents 6cf6611 + cd33926 commit 07a0753
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions routers/repo/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
13 changes: 10 additions & 3 deletions templates/repo/release/new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 07a0753

Please sign in to comment.