demarches-normaliennes/app/views/users/dossiers/_list.html.haml
2018-01-12 11:32:43 +01:00

38 lines
1.5 KiB
Text

- if smart_listing.present?
%table#dossiers-list.table
%thead
%th#sort-id.col-md-1.col-lg-1.col-sm-1.col-xs-1= smart_listing.sortable 'Numéro', 'id'
%th#sort-libelle.col-xs-5= smart_listing.sortable 'Procédure', 'procedure.libelle'
%th#sort-state.col-xs-2= smart_listing.sortable 'État', 'state'
%th#sort-updated.col-xs-2= smart_listing.sortable 'Date de mise à jour', 'updated_at'
- if @liste == "brouillon"
%th.col-xs-2= 'Action'
- @dossiers.each do |dossier|
- if dossier.kind_of? Invite
- invite = dossier
- dossier = invite.dossier.decorate
- else
- dossier = dossier.decorate
- dossier_url = users_dossiers_invite_path(id: invite.id) if invite.present?
- if invite.nil?
- dossier_url = users_dossier_recapitulatif_path(dossier) if !dossier.brouillon?
- dossier_url = users_dossier_description_path(dossier) if dossier.brouillon?
%tr{ id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => dossier_url }
%td.center
= dossier.id
%td
= dossier.procedure.libelle
%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-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
%br
- else
%h4.center
Aucun dossier