Action button for instruction state
This commit is contained in:
parent
059a0b961b
commit
feda7213f9
4 changed files with 92 additions and 4 deletions
9
app/assets/javascripts/new_design/state_button.js
Normal file
9
app/assets/javascripts/new_design/state_button.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
TPS.acceptDossier = function () {
|
||||
$(".motivation").show();
|
||||
$(".dropdown-items").hide();
|
||||
}
|
||||
|
||||
TPS.motivationCancel = function () {
|
||||
$(".motivation").hide();
|
||||
$(".dropdown-items").show();
|
||||
}
|
29
app/assets/stylesheets/new_design/motivation.scss
Normal file
29
app/assets/stylesheets/new_design/motivation.scss
Normal file
|
@ -0,0 +1,29 @@
|
|||
@import "colors";
|
||||
@import "constants";
|
||||
|
||||
.motivation {
|
||||
display: none;
|
||||
padding: $default-padding;
|
||||
color: $black;
|
||||
width: 450px;
|
||||
|
||||
h3 {
|
||||
font-size: 22px;
|
||||
margin-bottom: $default-spacer * 2;
|
||||
|
||||
i {
|
||||
vertical-align: sub;
|
||||
margin-right: $default-spacer;
|
||||
}
|
||||
}
|
||||
|
||||
textarea {
|
||||
margin-bottom: $default-spacer;
|
||||
}
|
||||
|
||||
.help {
|
||||
color: $grey;
|
||||
font-size: 11px;
|
||||
margin-bottom: $default-spacer * 2;
|
||||
}
|
||||
}
|
|
@ -143,7 +143,7 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
|
|||
|
||||
NotificationMailer.send_notification(dossier, template, attestation_pdf).deliver_now!
|
||||
|
||||
redirect_to backoffice_dossier_path(id: dossier.id)
|
||||
redirect_to_dossier(dossier)
|
||||
end
|
||||
|
||||
def reload_smartlisting
|
||||
|
@ -180,9 +180,9 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
|
|||
create_dossier_facade params[:dossier_id]
|
||||
|
||||
@facade.dossier.replied!
|
||||
flash.notice = 'Dossier réouvert.'
|
||||
flash.notice = 'Dossier repassé en construction.'
|
||||
|
||||
redirect_to backoffice_dossiers_path
|
||||
redirect_to_dossier(@facade.dossier)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- if dossier.en_construction?
|
||||
- if dossier.en_construction? || dossier.en_instruction?
|
||||
%span.button.primary.dropdown
|
||||
= dossier.decorate.display_state
|
||||
.dropdown-content.fade-in-down
|
||||
|
@ -15,3 +15,53 @@
|
|||
.description
|
||||
%h4 Passer en instruction
|
||||
L'usager ne pourra plus modifier le formulaire
|
||||
|
||||
- if dossier.en_instruction?
|
||||
%li
|
||||
= link_to backoffice_dossier_reopen_path(dossier), method: :post, data: { confirm: "Confirmer vous la réouverture de ce dossier ?" } do
|
||||
%i.edit
|
||||
.description
|
||||
%h4 Repasser en construction
|
||||
Vous permettrez à l'usager de modifier ses réponses au formulaire
|
||||
%li.selected
|
||||
%i.in-progress
|
||||
.description
|
||||
%h4 En instruction
|
||||
L'usager ne peut modifer son dossier pendant l'instruction
|
||||
%li{ onclick: "TPS.acceptDossier();" }
|
||||
%i.accept
|
||||
.description
|
||||
%h4 Accepter
|
||||
L'usager sera notifié que son dossier a été accepté
|
||||
%li
|
||||
= link_to backoffice_dossier_process_dossier_path(dossier, process_action: "without_continuation"), method: :post, data: { confirm: "Confirmer vous le classement sans suite de ce dossier ?" } do
|
||||
%i.without-continuation
|
||||
.description
|
||||
%h4 Classer sans suite
|
||||
L'usager ne recevra aucune notification
|
||||
%li
|
||||
= link_to backoffice_dossier_process_dossier_path(dossier, process_action: "refuse"), method: :post, data: { confirm: "Confirmer vous le refus de ce dossier ?" } do
|
||||
%i.close
|
||||
.description
|
||||
%h4 Refuser
|
||||
L'usager sera notifié que son dossier a été refusé
|
||||
.motivation
|
||||
%h3
|
||||
%i.accept
|
||||
Accepter le dossier
|
||||
= "nº #{dossier.id}"
|
||||
|
||||
= form_tag(backoffice_dossier_process_dossier_url(dossier.id), method: :post, class: "form") do
|
||||
= text_area :dossier, :motivation, class: "motivation-text-area", placeholder: "Rédigez votre motivation ici (facultative)"
|
||||
%p.help
|
||||
L'acceptation du dossier envoie automatiquement une attestation à l'usager.
|
||||
.text-right
|
||||
%span.button{ onclick: "TPS.motivationCancel();" } Annuler
|
||||
= button_tag "Valider la décision", name: :process_action, value: "close", class: 'button primary', title: 'Accepter', data: { confirm: "Accepter ce dossier ?" }
|
||||
|
||||
- elsif dossier.closed?
|
||||
%span.label.closed Accepté
|
||||
- elsif dossier.refused?
|
||||
%span.label.refused Refusé
|
||||
- elsif dossier.without_continuation?
|
||||
%span.label.without-continuation Sans suite
|
||||
|
|
Loading…
Reference in a new issue