2015-09-22 10:15:12 +02:00
|
|
|
class BackofficeController < ApplicationController
|
2017-04-27 12:17:50 +02:00
|
|
|
include SmartListing::Helper::ControllerExtensions
|
|
|
|
helper SmartListing::Helper
|
|
|
|
|
|
|
|
before_action :authenticate_gestionnaire!, only: [:invitations]
|
2015-09-22 10:15:12 +02:00
|
|
|
|
|
|
|
def index
|
2015-11-10 11:58:56 +01:00
|
|
|
if !gestionnaire_signed_in?
|
|
|
|
redirect_to(controller: '/gestionnaires/sessions', action: :new)
|
|
|
|
else
|
2015-12-02 18:03:52 +01:00
|
|
|
redirect_to(:backoffice_dossiers)
|
2015-11-10 11:58:56 +01:00
|
|
|
end
|
2015-09-22 10:15:12 +02:00
|
|
|
end
|
2017-04-27 12:17:50 +02:00
|
|
|
|
|
|
|
def invitations
|
|
|
|
pending_avis = current_gestionnaire.avis.without_answer.includes(dossier: [:procedure]).by_latest
|
|
|
|
@pending_avis = smart_listing_create :pending_avis,
|
2017-06-12 13:49:51 +02:00
|
|
|
pending_avis,
|
|
|
|
partial: 'backoffice/dossiers/list_invitations',
|
|
|
|
array: true
|
2017-04-27 12:17:50 +02:00
|
|
|
|
|
|
|
avis_with_answer = current_gestionnaire.avis.with_answer.includes(dossier: [:procedure]).by_latest
|
|
|
|
@avis_with_answer = smart_listing_create :avis_with_answer,
|
2017-06-12 13:49:51 +02:00
|
|
|
avis_with_answer,
|
|
|
|
partial: 'backoffice/dossiers/list_invitations',
|
|
|
|
array: true
|
2017-04-27 12:17:50 +02:00
|
|
|
end
|
2017-04-04 15:27:04 +02:00
|
|
|
end
|