Redirect admins with no démarches to the new demarche page

This commit is contained in:
Chaïb Martinez 2018-12-28 18:24:39 +01:00 committed by gregoirenovel
parent e88a3f8dbf
commit 802f2086d6
5 changed files with 16 additions and 7 deletions

View file

@ -5,12 +5,16 @@ class Admin::ProceduresController < AdminController
before_action :retrieve_procedure, only: [:show, :edit, :delete_logo, :delete_deliberation, :delete_notice]
def index
@procedures = smart_listing_create :procedures,
current_administrateur.procedures.publiees.order(published_at: :desc),
partial: "admin/procedures/list",
array: true
if current_administrateur.procedures.count != 0
@procedures = smart_listing_create :procedures,
current_administrateur.procedures.publiees.order(published_at: :desc),
partial: "admin/procedures/list",
array: true
active_class
active_class
else
redirect_to new_from_existing_admin_procedures_path
end
end
def archived