Show warning on dossier pages when procedure is brouillon
This commit is contained in:
parent
ad66c1e30d
commit
fba0fad22e
1 changed files with 7 additions and 0 deletions
|
@ -10,6 +10,7 @@ module NewUser
|
|||
before_action :ensure_dossier_can_be_updated, only: [:update_identite, :update_brouillon, :modifier, :update]
|
||||
before_action :forbid_invite_submission!, only: [:update_brouillon]
|
||||
before_action :forbid_closed_submission!, only: [:update_brouillon]
|
||||
before_action :show_demarche_en_test_banner
|
||||
|
||||
def index
|
||||
@user_dossiers = current_user.dossiers.includes(:procedure).order_by_updated_at.page(page)
|
||||
|
@ -211,6 +212,12 @@ module NewUser
|
|||
|
||||
private
|
||||
|
||||
def show_demarche_en_test_banner
|
||||
if @dossier.present? && @dossier.procedure.brouillon?
|
||||
flash.now.notice = "Ce dossier est déposé sur une démarche en test. Il sera supprimé lors de la publication de la démarche."
|
||||
end
|
||||
end
|
||||
|
||||
def ensure_dossier_can_be_updated
|
||||
if !dossier.can_be_updated_by_the_user?
|
||||
flash.alert = 'Votre dossier ne peut plus être modifié'
|
||||
|
|
Loading…
Reference in a new issue