commit
c298a048c0
3 changed files with 6 additions and 4 deletions
|
@ -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'));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue