diff --git a/app/assets/stylesheets/new_design/buttons.scss b/app/assets/stylesheets/new_design/buttons.scss index 16dc43c7b..6fe9cb876 100644 --- a/app/assets/stylesheets/new_design/buttons.scss +++ b/app/assets/stylesheets/new_design/buttons.scss @@ -183,7 +183,7 @@ color: $black; padding: $default-padding; - h4 { + .title { font-size: 24px; } @@ -266,6 +266,10 @@ color: $black; margin-bottom: $default-spacer; } + + &.with-top-border { + border-top: 1px solid $grey; + } } .dropdown-form { diff --git a/app/controllers/gestionnaires/dossiers_controller.rb b/app/controllers/gestionnaires/dossiers_controller.rb index 6dfd065d5..1a8f82132 100644 --- a/app/controllers/gestionnaires/dossiers_controller.rb +++ b/app/controllers/gestionnaires/dossiers_controller.rb @@ -93,6 +93,12 @@ module Gestionnaires render partial: 'state_button_refresh', locals: { dossier: dossier } end + def repasser_en_instruction + flash.notice = "Le dossier #{dossier.id} a été repassé en instruction." + + render partial: 'state_button_refresh', locals: { dossier: dossier } + end + def terminer motivation = params[:dossier] && params[:dossier][:motivation] justificatif = params[:dossier] && params[:dossier][:justificatif_motivation] diff --git a/app/views/gestionnaires/dossiers/_state_button.html.haml b/app/views/gestionnaires/dossiers/_state_button.html.haml index 18d0a42be..e186ff2ee 100644 --- a/app/views/gestionnaires/dossiers/_state_button.html.haml +++ b/app/views/gestionnaires/dossiers/_state_button.html.haml @@ -58,14 +58,24 @@ = dossier_display_state(dossier, lower: true) .dropdown-content.fade-in-down.terminated - if dossier.motivation.present? - %h4 Motivation + %h4.title Motivation %p.dossier-motivation= dossier.motivation = render partial: 'users/dossiers/show/download_justificatif', locals: { dossier: dossier } - if dossier.attestation.present? - %h4 Attestation + %h4.title Attestation %p.attestation L'acceptation du dossier a envoyé automatiquement une attestation au demandeur = link_to "Voir l'attestation", attestation_gestionnaire_dossier_path(dossier.procedure, dossier), target: '_blank', rel: 'noopener', class: 'button' + + + - if dossier.refuse? || dossier.sans_suite? + %ul.dropdown-items.with-top-border + %li + = link_to repasser_en_instruction_gestionnaire_dossier_path(dossier.procedure, dossier), method: :post, data: { remote:true, confirm: "Voulez vous remettre le dossier #{dossier.id} en instruction ?" } do + %span.icon.in-progress + .dropdown-description + %h4 Repasser en instruction + L’usager sera notifié que son dossier est réexaminé. - else %span.label{ class: button_or_label_class(dossier) } = dossier_display_state(dossier, lower: true) diff --git a/config/routes.rb b/config/routes.rb index e6006507c..682ed5802 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -325,6 +325,7 @@ Rails.application.routes.draw do post 'commentaire' => 'dossiers#create_commentaire' post 'passer-en-instruction' => 'dossiers#passer_en_instruction' post 'repasser-en-construction' => 'dossiers#repasser_en_construction' + post 'repasser-en-instruction' => 'dossiers#repasser_en_instruction' post 'terminer' post 'send-to-instructeurs' => 'dossiers#send_to_instructeurs' post 'avis' => 'dossiers#create_avis'