feat(procedures#index): add dossiers-expirant to instructeur/procedure#index
This commit is contained in:
parent
731f8c3063
commit
f8a17b2cc4
3 changed files with 13 additions and 3 deletions
|
@ -15,9 +15,9 @@ module Instructeurs
|
||||||
dossiers = current_instructeur.dossiers.joins(:groupe_instructeur)
|
dossiers = current_instructeur.dossiers.joins(:groupe_instructeur)
|
||||||
@dossiers_count_per_procedure = dossiers.all_state.group('groupe_instructeurs.procedure_id').reorder(nil).count
|
@dossiers_count_per_procedure = dossiers.all_state.group('groupe_instructeurs.procedure_id').reorder(nil).count
|
||||||
@dossiers_a_suivre_count_per_procedure = dossiers.without_followers.en_cours.group('groupe_instructeurs.procedure_id').reorder(nil).count
|
@dossiers_a_suivre_count_per_procedure = dossiers.without_followers.en_cours.group('groupe_instructeurs.procedure_id').reorder(nil).count
|
||||||
@dossiers_archived_count_per_procedure = dossiers.archived.group('groupe_instructeurs.procedure_id').count
|
@dossiers_archived_count_per_procedure = dossiers.archived.group('groupe_instructeurs.procedure_id').count #why not reorder(nil)
|
||||||
@dossiers_termines_count_per_procedure = dossiers.termine.group('groupe_instructeurs.procedure_id').reorder(nil).count
|
@dossiers_termines_count_per_procedure = dossiers.termine.group('groupe_instructeurs.procedure_id').reorder(nil).count
|
||||||
|
@dossiers_expirant_count_per_procedure = dossiers.close_to_expiration.group('groupe_instructeurs.procedure_id').count #why not reorder(nil)
|
||||||
groupe_ids = current_instructeur.groupe_instructeurs.pluck(:id)
|
groupe_ids = current_instructeur.groupe_instructeurs.pluck(:id)
|
||||||
|
|
||||||
@followed_dossiers_count_per_procedure = current_instructeur
|
@followed_dossiers_count_per_procedure = current_instructeur
|
||||||
|
@ -34,7 +34,8 @@ module Instructeurs
|
||||||
'suivis' => @followed_dossiers_count_per_procedure.sum { |_, v| v },
|
'suivis' => @followed_dossiers_count_per_procedure.sum { |_, v| v },
|
||||||
'traités' => @dossiers_termines_count_per_procedure.sum { |_, v| v },
|
'traités' => @dossiers_termines_count_per_procedure.sum { |_, v| v },
|
||||||
'dossiers' => @dossiers_count_per_procedure.sum { |_, v| v },
|
'dossiers' => @dossiers_count_per_procedure.sum { |_, v| v },
|
||||||
'archivés' => @dossiers_archived_count_per_procedure.sum { |_, v| v }
|
'archivés' => @dossiers_archived_count_per_procedure.sum { |_, v| v },
|
||||||
|
'expirant' => @dossiers_expirant_count_per_procedure.sum { |_, v| v }
|
||||||
}
|
}
|
||||||
|
|
||||||
@procedure_ids_en_cours_with_notifications = current_instructeur.procedure_ids_with_notifications(:en_cours)
|
@procedure_ids_en_cours_with_notifications = current_instructeur.procedure_ids_with_notifications(:en_cours)
|
||||||
|
|
|
@ -52,6 +52,14 @@
|
||||||
= number_with_html_delimiter(archived_count)
|
= number_with_html_delimiter(archived_count)
|
||||||
.stats-legend
|
.stats-legend
|
||||||
= t('pluralize.archived', count: archived_count)
|
= t('pluralize.archived', count: archived_count)
|
||||||
|
%li
|
||||||
|
%object
|
||||||
|
= link_to(instructeur_procedure_path(p, statut: 'expirant')) do
|
||||||
|
- expirant_count = dossiers_expirant_count_per_procedure[p.id] || 0
|
||||||
|
.stats-number
|
||||||
|
= number_with_html_delimiter(expirant_count)
|
||||||
|
.stats-legend
|
||||||
|
= t('pluralize.dossiers_close_to_expiration', count: expirant_count)
|
||||||
|
|
||||||
- if p.close?
|
- if p.close?
|
||||||
.procedure-status
|
.procedure-status
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
dossiers_a_suivre_count_per_procedure: @dossiers_a_suivre_count_per_procedure,
|
dossiers_a_suivre_count_per_procedure: @dossiers_a_suivre_count_per_procedure,
|
||||||
dossiers_archived_count_per_procedure: @dossiers_archived_count_per_procedure,
|
dossiers_archived_count_per_procedure: @dossiers_archived_count_per_procedure,
|
||||||
dossiers_termines_count_per_procedure: @dossiers_termines_count_per_procedure,
|
dossiers_termines_count_per_procedure: @dossiers_termines_count_per_procedure,
|
||||||
|
dossiers_expirant_count_per_procedure: @dossiers_expirant_count_per_procedure,
|
||||||
followed_dossiers_count_per_procedure: @followed_dossiers_count_per_procedure,
|
followed_dossiers_count_per_procedure: @followed_dossiers_count_per_procedure,
|
||||||
procedure_ids_en_cours_with_notifications: @procedure_ids_en_cours_with_notifications,
|
procedure_ids_en_cours_with_notifications: @procedure_ids_en_cours_with_notifications,
|
||||||
procedure_ids_termines_with_notifications: @procedure_ids_termines_with_notifications }
|
procedure_ids_termines_with_notifications: @procedure_ids_termines_with_notifications }
|
||||||
|
|
Loading…
Reference in a new issue