demarches-normaliennes/app/controllers/backoffice_controller.rb

29 lines
1 KiB
Ruby
Raw Normal View History

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