feat(procedure): add closing details page

This commit is contained in:
Eric Leroy-Terquem 2024-02-15 11:21:31 +01:00
parent facb38b539
commit d800213920
7 changed files with 38 additions and 5 deletions

View file

@ -78,6 +78,11 @@ module Users
current_user ? :user : :guest
end
def closing_details
@procedure = Procedure.find_by(path: params[:path])
render 'closing_details', layout: 'closing_details'
end
private
def extra_query_params
@ -136,9 +141,8 @@ module Users
redirect_to commencer_path(procedure.replaced_by_procedure.path, **extra_query_params)
return
elsif procedure&.close?
flash.alert = procedure.service.presence ?
t('errors.messages.procedure_archived.with_service_and_phone_email', service_name: procedure.service.nom, service_phone_number: procedure.service.telephone, service_email: procedure.service.email) :
t('errors.messages.procedure_archived.with_organisation_only', organisation_name: procedure.organisation)
redirect_to closing_details_path(procedure.path)
return
else
flash.alert = t('errors.messages.procedure_not_found')
end