Merge pull request #880 from sgmap/fix-864

Fix #864
This commit is contained in:
gregoirenovel 2017-10-19 15:00:55 +02:00 committed by GitHub
commit c298a048c0
3 changed files with 6 additions and 4 deletions

View file

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

View file

@ -161,7 +161,7 @@ class Users::DossiersController < UsersController
dossier.destroy dossier.destroy
flash.notice = 'Brouillon supprimé' flash.notice = 'Brouillon supprimé'
end end
redirect_to url_for users_dossiers_path redirect_to url_for users_dossiers_path(liste: 'brouillon')
end end
def text_summary def text_summary

View file

@ -27,7 +27,7 @@
%td{ id: "dossier_#{dossier.id}_state" }= dossier.display_state %td{ id: "dossier_#{dossier.id}_state" }= dossier.display_state
%td= dossier.last_update %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.paginate
= smart_listing.pagination_per_page_links = smart_listing.pagination_per_page_links