2015-10-23 16:19:55 +02:00
|
|
|
class AdminController < ApplicationController
|
2015-11-16 16:16:08 +01:00
|
|
|
before_action :authenticate_administrateur!
|
2015-10-23 16:19:55 +02:00
|
|
|
|
|
|
|
def index
|
2018-12-24 17:36:18 +01:00
|
|
|
redirect_to(admin_procedures_path)
|
2015-10-23 16:19:55 +02:00
|
|
|
end
|
2015-12-21 12:02:53 +01:00
|
|
|
|
|
|
|
def retrieve_procedure
|
2015-12-24 15:57:03 +01:00
|
|
|
id = params[:procedure_id] || params[:id]
|
2015-12-21 12:02:53 +01:00
|
|
|
|
|
|
|
@procedure = current_administrateur.procedures.find(id)
|
|
|
|
|
2015-12-24 15:57:03 +01:00
|
|
|
rescue ActiveRecord::RecordNotFound
|
2018-09-05 14:48:42 +02:00
|
|
|
flash.alert = 'Démarche inexistante'
|
2015-12-24 15:57:03 +01:00
|
|
|
redirect_to admin_procedures_path, status: 404
|
|
|
|
end
|
|
|
|
|
2018-08-13 17:49:15 +02:00
|
|
|
def reset_procedure
|
2019-09-16 16:59:10 +02:00
|
|
|
if @procedure.brouillon?
|
2018-08-13 17:49:15 +02:00
|
|
|
@procedure.reset!
|
|
|
|
end
|
|
|
|
end
|
2015-10-23 16:19:55 +02:00
|
|
|
end
|