demarches-normaliennes/app/views/users/dossiers/_list.html.haml

39 lines
1.5 KiB
Text
Raw Normal View History

2018-01-11 19:04:39 +01:00
- if smart_listing.present?
%table#dossiers-list.table
2016-01-08 11:39:04 +01:00
%thead
2016-12-23 16:58:06 +01:00
%th#sort-id.col-md-1.col-lg-1.col-sm-1.col-xs-1= smart_listing.sortable 'Numéro', 'id'
2017-02-14 17:08:14 +01:00
%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"
2017-02-14 17:08:14 +01:00
%th.col-xs-2= 'Action'
2016-01-08 11:39:04 +01:00
- @dossiers.each do |dossier|
2016-09-13 15:54:26 +02:00
- if dossier.kind_of? Invite
- invite = dossier
- dossier = invite.dossier.decorate
- else
- dossier = dossier.decorate
2018-01-11 19:04:39 +01:00
- dossier_url = users_dossiers_invite_path(id: invite.id) if invite.present?
- if invite.nil?
2018-01-11 19:04:39 +01:00
- dossier_url = users_dossier_recapitulatif_path(dossier) if !dossier.brouillon?
- dossier_url = modifier_dossier_path(dossier) if dossier.brouillon?
2017-04-06 19:10:25 +02:00
%tr{ id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => dossier_url }
2016-08-30 11:18:43 +02:00
%td.center
= dossier.id
2016-01-08 11:39:04 +01:00
%td
= dossier.procedure.libelle
2017-04-06 19:10:25 +02:00
%td{ id: "dossier_#{dossier.id}_state" }= dossier.display_state
2016-01-08 11:39:04 +01:00
%td= dossier.last_update
2018-02-14 11:44:26 +01:00
%td= link_to('X', url_for(controller: 'dossiers', action: :destroy, id: dossier.id), 'data-confirm' => "Voulez-vous supprimer le brouillon ?", 'data-method' => :delete, class: 'btn-sm btn-danger') if @liste == "brouillon"
2015-11-26 12:29:34 +01:00
2016-01-08 11:39:04 +01:00
= smart_listing.paginate
= smart_listing.pagination_per_page_links
%br
2016-01-08 11:39:04 +01:00
- else
%h4.center
Aucun dossier