demarches-normaliennes/app/views/admin/procedures/_list.html.haml
2019-06-24 17:00:10 +02:00

38 lines
1.8 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

- if smart_listing.present?
%table.table#dossiers-list
%thead
%th#ID= smart_listing.sortable 'ID', 'id'
%th#libelle= smart_listing.sortable 'Libellé', 'libelle'
- if @active_class
%th Lien
- if @active_class || @archived_class
%th#published_at= smart_listing.sortable 'Date publication', 'published_at'
- else
%th#created_at= smart_listing.sortable 'Date création', 'created_at'
%th Actions
- @procedures.each do |procedure|
- procedure = procedure
- admin_procedure_href = admin_procedure_path(procedure)
%tr{ id: "tr_dossier_#{procedure.id}", data: { href: admin_procedure_href } }
%td= link_to(procedure.id, admin_procedure_href)
%td.col-xs-6= link_to(procedure.libelle, admin_procedure_href)
- if procedure.publiee?
%td.procedure-lien= link_to(procedure_lien(procedure), procedure_lien(procedure))
- if procedure.publiee_ou_archivee?
%td= link_to(procedure.published_at.present? ? try_format_datetime(procedure.published_at) : "", admin_procedure_href)
- else
%td= link_to(try_format_datetime(procedure.created_at), admin_procedure_href)
%td
= link_to('Cloner', admin_procedure_clone_path(procedure.id), data: { method: :put }, class: 'btn-sm btn-primary clone-btn')
- if !procedure.publiee_ou_archivee?
= link_to('X', url_for(controller: 'admin/procedures', action: :destroy, id: procedure.id), data: { method: :delete, confirm: "Confirmez-vous la suppression de la démarche ? \n\n Attention : toute suppression est définitive et sappliquera aux éventuels autres administrateurs de cette démarche !" }, class: 'btn-sm btn-danger')
= smart_listing.paginate
= smart_listing.pagination_per_page_links
%br
- else
%h4.center
Aucune démarche