2015-09-22 15:00:59 +02:00
|
|
|
class Backoffice::DossiersController < ApplicationController
|
2015-09-22 10:15:12 +02:00
|
|
|
before_action :authenticate_gestionnaire!
|
2015-08-10 11:05:06 +02:00
|
|
|
|
|
|
|
def show
|
2015-09-22 15:00:59 +02:00
|
|
|
@dossier = Dossier.find(params[:id])
|
2015-08-10 11:05:06 +02:00
|
|
|
@entreprise = @dossier.entreprise.decorate
|
2015-08-11 15:38:34 +02:00
|
|
|
@etablissement = @dossier.etablissement
|
2015-09-21 17:59:03 +02:00
|
|
|
@pieces_justificatives = @dossier.pieces_justificatives
|
2015-08-10 11:05:06 +02:00
|
|
|
@commentaires = @dossier.commentaires.order(created_at: :desc)
|
|
|
|
@commentaires = @commentaires.all.decorate
|
2015-09-22 10:15:12 +02:00
|
|
|
@commentaire_email = current_gestionnaire.email
|
2015-08-10 11:05:06 +02:00
|
|
|
|
2015-09-21 17:59:03 +02:00
|
|
|
@procedure = @dossier.procedure
|
2015-08-20 12:20:54 +02:00
|
|
|
|
2015-08-10 11:05:06 +02:00
|
|
|
@dossier = @dossier.decorate
|
2015-08-13 15:55:19 +02:00
|
|
|
rescue ActiveRecord::RecordNotFound
|
2015-08-10 11:05:06 +02:00
|
|
|
redirect_start
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def redirect_start
|
2015-08-20 16:32:25 +02:00
|
|
|
redirect_to url_for(controller: '/start', action: :error_dossier)
|
2015-08-10 11:05:06 +02:00
|
|
|
end
|
|
|
|
end
|