diff --git a/app/views/instructeurs/dossiers/_header_actions.html.haml b/app/views/instructeurs/dossiers/_header_actions.html.haml index 47f7b4893..a680b9f8d 100644 --- a/app/views/instructeurs/dossiers/_header_actions.html.haml +++ b/app/views/instructeurs/dossiers/_header_actions.html.haml @@ -28,7 +28,8 @@ state: dossier.state, archived: dossier.archived, dossier_is_followed: current_instructeur&.follow?(dossier), - close_to_expiration: dossier.close_to_expiration? } + close_to_expiration: dossier.close_to_expiration?, + supprimes_recemment: dossier.hidden_by_administration? } .state-button diff --git a/app/views/instructeurs/procedures/_dossier_actions.html.haml b/app/views/instructeurs/procedures/_dossier_actions.html.haml index 87add5c29..ad122588b 100644 --- a/app/views/instructeurs/procedures/_dossier_actions.html.haml +++ b/app/views/instructeurs/procedures/_dossier_actions.html.haml @@ -21,12 +21,18 @@ %span.icon.archive .dropdown-description Archiver le dossier - - %li.danger - = link_to supprimer_dossier_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, data: { confirm: "Voulez vous vraiment supprimer le dossier #{dossier_id} ? Cette action est irréversible. \nNous vous suggérons de télécharger le dossier au format PDF au préalable." } do - %span.icon.delete - .dropdown-description - = t('views.instructeurs.dossiers.delete_dossier') + - if supprimes_recemment + %li.danger + = link_to restore_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, data: { confirm: "Voulez vous vraiment restaurer le dossier #{dossier_id}" } do + %span.icon.reply + .dropdown-description + = t('views.instructeurs.dossiers.restore') + - else + %li.danger + = link_to supprimer_dossier_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, data: { confirm: "Voulez vous vraiment supprimer le dossier #{dossier_id} ? Cette action est irréversible. \nNous vous suggérons de télécharger le dossier au format PDF au préalable." } do + %span.icon.delete + .dropdown-description + = t('views.instructeurs.dossiers.delete_dossier') - elsif Dossier::EN_CONSTRUCTION_OU_INSTRUCTION.include?(state) - if dossier_is_followed diff --git a/app/views/instructeurs/procedures/_list.html.haml b/app/views/instructeurs/procedures/_list.html.haml index 6f60a13af..073a1bea9 100644 --- a/app/views/instructeurs/procedures/_list.html.haml +++ b/app/views/instructeurs/procedures/_list.html.haml @@ -45,6 +45,15 @@ .stats-legend = t('pluralize.case', count: dossier_count) + %li + %object + = link_to(instructeur_procedure_path(p, statut: 'supprimes_recemment')) do + - dossier_count = dossiers_supprimes_recemment_count_per_procedure[p.id] || 0 + .stats-number + = number_with_html_delimiter(dossier_count) + .stats-legend + = t('pluralize.dossiers_supprimes_recemment', count: dossier_count) + - if p.procedure_expires_when_termine_enabled %li %object diff --git a/app/views/instructeurs/procedures/_tabs.html.haml b/app/views/instructeurs/procedures/_tabs.html.haml index e1337fdaa..9b35e6d70 100644 --- a/app/views/instructeurs/procedures/_tabs.html.haml +++ b/app/views/instructeurs/procedures/_tabs.html.haml @@ -22,6 +22,11 @@ active: statut == 'tous', badge: number_with_html_delimiter(tous_count)) + = tab_item(t('pluralize.dossiers_supprimes_recemment', count: supprimes_recemment_count), + instructeur_procedure_path(procedure, statut: 'supprimes_recemment'), + active: statut == 'supprimes_recemment', + badge: number_with_html_delimiter(supprimes_recemment_count)) + - if procedure.procedure_expires_when_termine_enabled = tab_item(t('pluralize.dossiers_close_to_expiration', count: expirant_count), instructeur_procedure_path(procedure, statut: 'expirant'), diff --git a/app/views/instructeurs/procedures/index.html.haml b/app/views/instructeurs/procedures/index.html.haml index 4356c463e..cfafa34b1 100644 --- a/app/views/instructeurs/procedures/index.html.haml +++ b/app/views/instructeurs/procedures/index.html.haml @@ -13,6 +13,7 @@ dossiers_archived_count_per_procedure: @dossiers_archived_count_per_procedure, dossiers_termines_count_per_procedure: @dossiers_termines_count_per_procedure, dossiers_expirant_count_per_procedure: @dossiers_expirant_count_per_procedure, + dossiers_supprimes_recemment_count_per_procedure: @dossiers_supprimes_recemment_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 } diff --git a/app/views/instructeurs/procedures/show.html.haml b/app/views/instructeurs/procedures/show.html.haml index 4738e7f6e..dfeb65b78 100644 --- a/app/views/instructeurs/procedures/show.html.haml +++ b/app/views/instructeurs/procedures/show.html.haml @@ -17,6 +17,7 @@ suivis_count: @suivis_count, traites_count: @traites_count, tous_count: @tous_count, + supprimes_recemment_count: @supprimes_recemment_count, archives_count: @archives_count, expirant_count: @expirant_count, has_en_cours_notifications: @has_en_cours_notifications, @@ -31,6 +32,8 @@ %p.explication-onglet Les dossiers dans cet onglet sont terminés : ils ont été acceptés, refusés ou classés sans suite. - if @statut == 'tous' %p.explication-onglet Tous les dossiers qui ont été déposés sur cette démarche, quel que soit le statut. + - if @statut == 'supprimes_recemment' + %p.explication-onglet Tous les dossiers terminés et supprimés par les instructeurs sur cette démarche - if @statut == 'archives' %p.explication-onglet Les dossiers de cet onglet sont archivés : vous ne pouvez plus y répondre, et les demandeurs ne peuvent plus les modifier. @@ -135,7 +138,8 @@ state: p.state, archived: p.archived, dossier_is_followed: @followed_dossiers_id.include?(p.dossier_id), - close_to_expiration: @statut == 'expirant' } + close_to_expiration: @statut == 'expirant', + supprimes_recemment: @statut == 'supprimes_recemment' } = pagination - else