Force state dossier in files lists on gestionnaire board

This commit is contained in:
Xavier J 2017-01-05 18:01:53 +01:00
parent b48726427d
commit ab02fe48c3
3 changed files with 35 additions and 24 deletions

View file

@ -22,6 +22,10 @@ class DossiersListFacades
current_devise_profil.dossiers.where(archived: false).count current_devise_profil.dossiers.where(archived: false).count
end end
def total_dossier_follow
@current_devise_profil.dossiers_follow.count
end
def total_new_dossier def total_new_dossier
current_devise_profil.dossiers.where(state: :initiated, archived: false).count current_devise_profil.dossiers.where(state: :initiated, archived: false).count
end end

View file

@ -1,17 +1,21 @@
%table#dossiers_list.table %table#dossiers_list.table
%thead %thead
- if smart_listing.name.to_s == 'follow_dossiers' - if smart_listing.name.to_s == 'follow_dossiers'
%th %th.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center
%i.fa.fa-bell %i.fa.fa-bell
%th.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1
État
- @facade_data_view.preference_list_dossiers_filter.each do |preference| - @facade_data_view.preference_list_dossiers_filter.each do |preference|
%th{class: "col-md-#{preference.bootstrap_lg} col-lg-#{preference.bootstrap_lg}"} - unless preference.libelle == 'Statut' || preference.libelle == 'État'
- if preference.table.to_s.include? 'champs' %th{class: "col-md-#{preference.bootstrap_lg} col-lg-#{preference.bootstrap_lg}"}
= preference.libelle - if preference.table.to_s.include? 'champs'
-else = preference.libelle
= smart_listing.sortable preference.libelle, preference.table_attr -else
- if @facade_data_view.active_filter? preference = smart_listing.sortable preference.libelle, preference.table_attr
%i.filter.fa.fa-filter{style: "color:#{(preference.filter.blank? ? 'grey' : 'orange')}", id: "filter_#{smart_listing.name.to_s}_#{preference.table_attr.sub('.', '_')}"} - if @facade_data_view.active_filter? preference
= render partial: 'backoffice/dossiers/filter_framed', locals:{preference: preference, filter_framed_id: "framed_filter_#{smart_listing.name.to_s}_#{preference.table_attr.sub('.', '_')}"} %i.filter.fa.fa-filter{style: "color:#{(preference.filter.blank? ? 'grey' : 'orange')}", id: "filter_#{smart_listing.name.to_s}_#{preference.table_attr.sub('.', '_')}"}
= render partial: 'backoffice/dossiers/filter_framed', locals:{preference: preference, filter_framed_id: "framed_filter_#{smart_listing.name.to_s}_#{preference.table_attr.sub('.', '_')}"}
%th.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center Actions %th.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center Actions
%th.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center Abonnés %th.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center Abonnés
@ -20,7 +24,7 @@
- smart_listing.collection.each do |dossier| - smart_listing.collection.each do |dossier|
%tr.dossier-row{id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => backoffice_dossier_url(id: dossier.id)} %tr.dossier-row{id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => backoffice_dossier_url(id: dossier.id)}
- if smart_listing.name.to_s == 'follow_dossiers' - if smart_listing.name.to_s == 'follow_dossiers'
%td.center %td.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center
- total_notif = dossier.notifications.where(already_read: false).count - total_notif = dossier.notifications.where(already_read: false).count
- if total_notif == 0 - if total_notif == 0
.badge.progress-bar-default .badge.progress-bar-default
@ -28,21 +32,24 @@
- else - else
.badge.progress-bar-warning .badge.progress-bar-warning
= total_notif = total_notif
%td.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1
= dossier.decorate.display_state
- @facade_data_view.preference_list_dossiers_filter.each_with_index do |preference, index| - @facade_data_view.preference_list_dossiers_filter.each_with_index do |preference, index|
%td - unless preference.libelle == 'Statut' || preference.libelle == 'État'
- if preference.table.nil? || preference.table.empty? %td
- value = dossier.decorate.public_send(preference.attr_decorate) - if preference.table.nil? || preference.table.empty?
- elsif preference.table == 'champs' - value = dossier.decorate.public_send(preference.attr_decorate)
- value = dossier.champs.find_by_type_de_champ_id(preference.attr).value - elsif preference.table == 'champs'
- elsif preference.table == 'champs_private' - value = dossier.champs.find_by_type_de_champ_id(preference.attr).value
- value = dossier.champs_private.find_by_type_de_champ_id(preference.attr).value - elsif preference.table == 'champs_private'
- else - value = dossier.champs_private.find_by_type_de_champ_id(preference.attr).value
- begin - else
- value = dossier.public_send(preference.table).decorate.public_send(preference.attr_decorate) - begin
- rescue NoMethodError - value = dossier.public_send(preference.table).decorate.public_send(preference.attr_decorate)
- value = '' - rescue NoMethodError
- value = ''
= value = value
%td.center %td.center
- if current_gestionnaire.follow?(dossier.id) - if current_gestionnaire.follow?(dossier.id)

View file

@ -1,6 +1,6 @@
%div#first-block %div#first-block
%div.dossiers-en-cours %div.dossiers-en-cours
.count= @facade_data_view.total_dossier .count= @facade_data_view.total_dossier_follow
.text= "SUIVIS" .text= "SUIVIS"
%div.nouveaux-dossiers %div.nouveaux-dossiers
.count= @facade_data_view.total_new_dossier .count= @facade_data_view.total_new_dossier