diff --git a/app/views/instructeurs/procedures/_list.html.haml b/app/views/instructeurs/procedures/_list.html.haml index 438587bb4..a0b1ca2a5 100644 --- a/app/views/instructeurs/procedures/_list.html.haml +++ b/app/views/instructeurs/procedures/_list.html.haml @@ -1,63 +1,61 @@ -%ul.procedure-list - - procedures.each do |p| - %li.procedure-item.flex.align-start - = link_to(instructeur_procedure_path(p)) do - .flex +%li.procedure-item.flex.align-start + = link_to(instructeur_procedure_path(p)) do + .flex - .procedure-logo{ style: "background-image: url(#{p.logo_url})" } + .procedure-logo{ style: "background-image: url(#{p.logo_url})" } - .procedure-details - %p.procedure-title - = procedure_libelle p - %ul.procedure-stats.flex - %li - %object - = link_to(instructeur_procedure_path(p, statut: 'a-suivre')) do - - a_suivre_count = dossiers_a_suivre_count_per_procedure[p.id] || 0 - .stats-number - = number_with_html_delimiter(a_suivre_count) - .stats-legend - à suivre - %li - %object - = link_to(instructeur_procedure_path(p, statut: 'suivis')) do - - if procedure_ids_en_cours_with_notifications.include?(p.id) - %span.notifications{ 'aria-label': "notifications" } - - followed_count = followed_dossiers_count_per_procedure[p.id] || 0 - .stats-number - = number_with_html_delimiter(followed_count) - .stats-legend - = t('pluralize.followed', count: followed_count) - %li - %object - = link_to(instructeur_procedure_path(p, statut: 'traites')) do - - if procedure_ids_termines_with_notifications.include?(p.id) - %span.notifications{ 'aria-label': "notifications" } - - termines_count = dossiers_termines_count_per_procedure[p.id] || 0 - .stats-number - = number_with_html_delimiter(termines_count) - .stats-legend - = t('pluralize.processed', count: termines_count) - %li - %object - = link_to(instructeur_procedure_path(p, statut: 'tous')) do - - dossier_count = dossiers_count_per_procedure[p.id] || 0 - .stats-number - = number_with_html_delimiter(dossier_count) - .stats-legend - = t('pluralize.case', count: dossier_count) - %li - %object - = link_to(instructeur_procedure_path(p, statut: 'archives')) do - - archived_count = dossiers_archived_count_per_procedure[p.id] || 0 - .stats-number - = number_with_html_delimiter(archived_count) - .stats-legend - = t('pluralize.archived', count: archived_count) + .procedure-details + %p.procedure-title + = procedure_libelle p + %ul.procedure-stats.flex + %li + %object + = link_to(instructeur_procedure_path(p, statut: 'a-suivre')) do + - a_suivre_count = dossiers_a_suivre_count_per_procedure[p.id] || 0 + .stats-number + = number_with_html_delimiter(a_suivre_count) + .stats-legend + à suivre + %li + %object + = link_to(instructeur_procedure_path(p, statut: 'suivis')) do + - if procedure_ids_en_cours_with_notifications.include?(p.id) + %span.notifications{ 'aria-label': "notifications" } + - followed_count = followed_dossiers_count_per_procedure[p.id] || 0 + .stats-number + = number_with_html_delimiter(followed_count) + .stats-legend + = t('pluralize.followed', count: followed_count) + %li + %object + = link_to(instructeur_procedure_path(p, statut: 'traites')) do + - if procedure_ids_termines_with_notifications.include?(p.id) + %span.notifications{ 'aria-label': "notifications" } + - termines_count = dossiers_termines_count_per_procedure[p.id] || 0 + .stats-number + = number_with_html_delimiter(termines_count) + .stats-legend + = t('pluralize.processed', count: termines_count) + %li + %object + = link_to(instructeur_procedure_path(p, statut: 'tous')) do + - dossier_count = dossiers_count_per_procedure[p.id] || 0 + .stats-number + = number_with_html_delimiter(dossier_count) + .stats-legend + = t('pluralize.case', count: dossier_count) + %li + %object + = link_to(instructeur_procedure_path(p, statut: 'archives')) do + - archived_count = dossiers_archived_count_per_procedure[p.id] || 0 + .stats-number + = number_with_html_delimiter(archived_count) + .stats-legend + = t('pluralize.archived', count: archived_count) - - if p.close? - .procedure-status - %span.label Close - - elsif p.depubliee? - .procedure-status - %span.label Dépubliée + - if p.close? + .procedure-status + %span.label Close + - elsif p.depubliee? + .procedure-status + %span.label Dépubliée diff --git a/app/views/instructeurs/procedures/index.html.haml b/app/views/instructeurs/procedures/index.html.haml index 405c3fc69..3616a7090 100644 --- a/app/views/instructeurs/procedures/index.html.haml +++ b/app/views/instructeurs/procedures/index.html.haml @@ -4,11 +4,14 @@ %h1.page-title Démarches = render partial: 'instructeurs/procedures/synthese', locals: { procedures: @procedures, all_dossiers_counts: @all_dossiers_counts } - = render partial: 'instructeurs/procedures/list', locals: { procedures: @procedures, - dossiers_count_per_procedure: @dossiers_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_termines_count_per_procedure: @dossiers_termines_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_termines_with_notifications: @procedure_ids_termines_with_notifications } + %ul.procedure-list + = render partial: 'instructeurs/procedures/list', + collection: @procedures, + as: :p, + locals: { dossiers_count_per_procedure: @dossiers_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_termines_count_per_procedure: @dossiers_termines_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_termines_with_notifications: @procedure_ids_termines_with_notifications }