Add feature delete for draft procedure

This commit is contained in:
Xavier J 2016-06-20 17:37:04 +02:00
parent 86e26e520c
commit 1dcb29ec65
9 changed files with 77 additions and 34 deletions

View file

@ -3,7 +3,9 @@
%thead
%th#ID= smart_listing.sortable 'ID', 'id'
%th#libelle= smart_listing.sortable 'Libellé', 'libelle'
%th#lien Lien
- unless @draft_class
%th#lien Lien
%th#created_at= smart_listing.sortable 'Date création', 'created_at'
%th#lien Actions
- @procedures.each do |procedure|
@ -12,8 +14,14 @@
%td.col-md-1.col-lg-1= procedure.id
%td.col-md-6.col-lg-6
= link_to(procedure.libelle, "/admin/procedures/#{procedure.id}")
%td= link_to procedure.lien, procedure.lien
%td= link_to('cloner', admin_procedure_clone_path(procedure.id), 'data-method' => :put, class: 'btn-xs btn-primary')
- unless @draft_class
%td= link_to procedure.lien, procedure.lien
%td
= procedure.created_at_fr
%td
= link_to('Cloner', admin_procedure_clone_path(procedure.id), 'data-method' => :put, class: 'btn-sm btn-primary')
- unless procedure.published? || procedure.archived?
= link_to('X', url_for(controller: 'admin/procedures', action: :destroy, id: procedure.id), 'data-method' => :delete, class: 'btn-sm btn-danger')
= smart_listing.paginate
= smart_listing.pagination_per_page_links