2015-09-23 19:20:03 +02:00
|
|
|
class Users::RecapitulatifController < UsersController
|
2015-08-10 11:05:06 +02:00
|
|
|
def show
|
2015-10-09 17:33:33 +02:00
|
|
|
@dossier = current_user_dossier
|
2015-08-10 11:05:06 +02:00
|
|
|
@dossier = @dossier.decorate
|
2015-09-24 10:17:59 +02:00
|
|
|
@procedure = @dossier.procedure
|
2015-11-04 11:14:07 +01:00
|
|
|
@champs = @dossier.ordered_champs
|
2015-08-10 11:05:06 +02:00
|
|
|
|
2015-11-04 11:14:07 +01:00
|
|
|
@commentaires = @dossier.ordered_commentaires
|
2015-08-10 11:05:06 +02:00
|
|
|
@commentaires = @commentaires.all.decorate
|
2015-08-13 15:55:19 +02:00
|
|
|
|
2015-11-04 11:14:07 +01:00
|
|
|
@commentaire_email = current_user.email
|
2015-08-25 10:49:28 +02:00
|
|
|
rescue ActiveRecord::RecordNotFound
|
2015-09-23 16:56:30 +02:00
|
|
|
flash.alert = t('errors.messages.dossier_not_found')
|
2015-10-09 17:33:33 +02:00
|
|
|
redirect_to url_for(root_path)
|
2015-08-10 11:05:06 +02:00
|
|
|
end
|
2015-09-24 16:51:14 +02:00
|
|
|
|
2015-11-02 15:31:15 +01:00
|
|
|
def initiate
|
2015-09-24 16:51:14 +02:00
|
|
|
show
|
|
|
|
|
2015-11-02 15:31:15 +01:00
|
|
|
@dossier.next_step! 'user', 'initiate'
|
2015-09-24 16:51:14 +02:00
|
|
|
flash.notice = 'Dossier soumis avec succès.'
|
|
|
|
|
|
|
|
render 'show'
|
|
|
|
end
|
|
|
|
|
2015-11-02 15:46:43 +01:00
|
|
|
def submit
|
2015-09-24 16:51:14 +02:00
|
|
|
show
|
|
|
|
|
2015-11-02 15:46:43 +01:00
|
|
|
@dossier.next_step! 'user', 'submit'
|
2015-09-24 16:51:14 +02:00
|
|
|
flash.notice = 'Dossier déposé avec succès.'
|
|
|
|
|
|
|
|
render 'show'
|
|
|
|
end
|
2015-08-10 11:05:06 +02:00
|
|
|
end
|