23 lines
593 B
Ruby
23 lines
593 B
Ruby
|
module NewGestionnaire
|
||
|
class AvisController < ApplicationController
|
||
|
layout 'new_application'
|
||
|
|
||
|
A_DONNER_STATUS = 'a-donner'
|
||
|
DONNES_STATUS = 'donnes'
|
||
|
|
||
|
def index
|
||
|
gestionnaire_avis = current_gestionnaire.avis.includes(dossier: [:procedure, :user])
|
||
|
@avis_a_donner, @avis_donnes = gestionnaire_avis.partition { |avis| avis.answer.nil? }
|
||
|
|
||
|
@statut = params[:statut].present? ? params[:statut] : A_DONNER_STATUS
|
||
|
|
||
|
@avis = case @statut
|
||
|
when A_DONNER_STATUS
|
||
|
@avis_a_donner
|
||
|
when DONNES_STATUS
|
||
|
@avis_donnes
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|