46 lines
No EOL
1.9 KiB
Text
46 lines
No EOL
1.9 KiB
Text
- unless smart_listing.empty?
|
|
%table.table
|
|
%thead
|
|
- @dossiers_list_facade.preference_list_dossiers_filter.each do |preference|
|
|
%th{class: "col-md-#{preference.bootstrap_lg} col-lg-#{preference.bootstrap_lg}"}
|
|
- if preference.table == 'champs'
|
|
= preference.libelle
|
|
-else
|
|
= smart_listing.sortable preference.libelle, preference.table_attr
|
|
|
|
%th.col-md-1.col-lg-1.center Actions
|
|
%th.col-md-1.col-lg-1.center Abonnés
|
|
|
|
- @dossiers.each do |dossier|
|
|
%tr
|
|
- @dossiers_list_facade.preference_list_dossiers_filter.each_with_index do |preference, index|
|
|
%td
|
|
- if preference.table.nil? || preference.table.empty?
|
|
- value = dossier.decorate.public_send(preference.attr_decorate)
|
|
- elsif preference.table == 'champs'
|
|
- value = dossier.champs.find_by_type_de_champ_id(preference.attr).value
|
|
- else
|
|
- begin
|
|
- value = dossier.public_send(preference.table).decorate.public_send(preference.attr_decorate)
|
|
- rescue NoMethodError
|
|
- value = ''
|
|
|
|
- if index == 0
|
|
= link_to value, backoffice_dossier_path(id: dossier.id)
|
|
- else
|
|
= value
|
|
|
|
%td.center
|
|
- if current_gestionnaire.follow?(dossier.id)
|
|
= link_to('Quitter'.html_safe, backoffice_dossier_follow_path(dossier_id: dossier.id), 'data-method' => :put, class: 'btn-sm btn-danger', id: "suivre_dossier_#{dossier.id}")
|
|
-else
|
|
= link_to('Suivre', backoffice_dossier_follow_path(dossier_id: dossier.id), 'data-method' => :put, class: 'btn-sm btn-primary', id: "suivre_dossier_#{dossier.id}")
|
|
%td.center{style:"color: #{dossier.total_follow == 0 ? 'red' : ''}"}
|
|
= dossier.total_follow
|
|
|
|
= smart_listing.paginate
|
|
= smart_listing.pagination_per_page_links
|
|
|
|
- else
|
|
%h4.center
|
|
Aucun dossier |