relance un expert
This commit is contained in:
parent
bde8fe2c5d
commit
d9cb5c067f
4 changed files with 31 additions and 0 deletions
|
@ -123,6 +123,18 @@ module Instructeurs
|
|||
end
|
||||
end
|
||||
|
||||
def revive
|
||||
avis = Avis.find(params[:id])
|
||||
if avis.answer.blank?
|
||||
AvisMailer.avis_invitation(avis).deliver_later
|
||||
flash.notice = "Un mail de relance a été envoyé à #{avis.email_to_display}"
|
||||
redirect_back(fallback_location: avis_instructeur_dossier_path(avis.procedure, avis.dossier))
|
||||
else
|
||||
flash.alert = "#{avis.email} a déjà donné son avis"
|
||||
redirect_back(fallback_location: avis_instructeur_dossier_path(avis.procedure, avis.dossier))
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_avis_and_dossier
|
||||
|
|
|
@ -35,7 +35,10 @@
|
|||
- else
|
||||
%span.waiting
|
||||
En attente de réponse
|
||||
|
|
||||
%span.waiting= link_to("Relancer l'expert", revive_instructeur_avis_path(avis.procedure, avis), data: { confirm: "Souhaitez-vous relancer #{avis.email_to_display} ?"})
|
||||
- if avis.revokable_by?(current_instructeur)
|
||||
|
|
||||
= link_to(t('revoke', scope: 'helpers.label'), revoquer_instructeur_avis_path(avis.procedure, avis), data: { confirm: "Souhaitez-vous révoquer la demande d'avis à #{avis.email_to_display} ?" }, method: :patch)
|
||||
- if avis.piece_justificative_file.attached?
|
||||
= render partial: 'shared/attachment/show', locals: { attachment: avis.piece_justificative_file.attachment }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue