Mercurial > kallithea
changeset 5403:4eb390c2d2bd
pullrequests: require extra confirmation before deleting a PR with comments
Make sure we don't lose any valueable data. A PR without comments doesn't have
much value.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 17 Aug 2015 01:11:42 +0200 |
parents | 7570d6665f0f |
children | 40c6fb22f3d6 |
files | kallithea/templates/pullrequests/pullrequest_data.html |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/templates/pullrequests/pullrequest_data.html Mon Aug 17 01:11:42 2015 +0200 +++ b/kallithea/templates/pullrequests/pullrequest_data.html Mon Aug 17 01:11:42 2015 +0200 @@ -65,7 +65,10 @@ id="remove_${pr.pull_request_id}" name="remove_${pr.pull_request_id}" title="${_('Delete Pull Request')}" - onclick="return confirm('${_('Confirm to delete this pull request')}');"> + onclick="return confirm('${_('Confirm to delete this pull request')}') + && ((${len(pr.comments)} == 0) || + confirm('${_('Confirm again to delete this pull request with %s comments') % len(pr.comments)}')) + "> <i class="icon-minus-circled"></i> </button> ${h.end_form()}