[Fix #864] Warn the user when they click the delete draft button

This commit is contained in:
gregoirenovel 2017-10-19 11:20:12 +02:00
parent 7be86796c1
commit fe84ff9e6c
2 changed files with 5 additions and 3 deletions

View file

@ -1,7 +1,9 @@
$(document).on('turbolinks:load', link_init);
function link_init() {
$('#dossiers-list tr').on('click', function () {
$(location).attr('href', $(this).data('dossier_url'))
$('#dossiers-list tr').on('click', function (event) {
if (event.target.className !== 'btn-sm btn-danger') {
$(location).attr('href', $(this).data('dossier_url'));
}
});
}

View file

@ -27,7 +27,7 @@
%td{ id: "dossier_#{dossier.id}_state" }= dossier.display_state
%td= dossier.last_update
%td= link_to('X', url_for(controller: 'dossiers', action: :destroy, id: dossier.id), 'data-method' => :delete, class: 'btn-sm btn-danger') if @liste == "brouillon"
%td= link_to('X', url_for(controller: 'dossiers', action: :destroy, id: dossier.id), 'data-confirm' => "Voulez-vous supprimer la brouillon ?", 'data-method' => :delete, class: 'btn-sm btn-danger') if @liste == "brouillon"
= smart_listing.paginate
= smart_listing.pagination_per_page_links