Add constants
This commit is contained in:
parent
86d867a7ea
commit
08f364ccdc
3 changed files with 7 additions and 4 deletions
|
@ -4,6 +4,9 @@ class Admin::AccompagnateursController < AdminController
|
||||||
|
|
||||||
before_action :retrieve_procedure
|
before_action :retrieve_procedure
|
||||||
|
|
||||||
|
ASSIGN = 'assign'
|
||||||
|
NOT_ASSIGN = 'not_assign'
|
||||||
|
|
||||||
def show
|
def show
|
||||||
assign_scope = @procedure.gestionnaires
|
assign_scope = @procedure.gestionnaires
|
||||||
|
|
||||||
|
@ -47,10 +50,10 @@ class Admin::AccompagnateursController < AdminController
|
||||||
to = params[:to]
|
to = params[:to]
|
||||||
|
|
||||||
case to
|
case to
|
||||||
when 'assign'
|
when ASSIGN
|
||||||
gestionnaire.assign_to_procedure(procedure)
|
gestionnaire.assign_to_procedure(procedure)
|
||||||
flash.notice = "L'accompagnateur a bien été affecté"
|
flash.notice = "L'accompagnateur a bien été affecté"
|
||||||
when 'not_assign'
|
when NOT_ASSIGN
|
||||||
gestionnaire.remove_from_procedure(procedure)
|
gestionnaire.remove_from_procedure(procedure)
|
||||||
flash.notice = "L'accompagnateur a bien été désaffecté"
|
flash.notice = "L'accompagnateur a bien été désaffecté"
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
- @accompagnateurs_assign.each do |accompagnateur|
|
- @accompagnateurs_assign.each do |accompagnateur|
|
||||||
%tr
|
%tr
|
||||||
%td.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center
|
%td.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center
|
||||||
%a.btn.btn-primary{ href: "#{admin_procedure_accompagnateurs_path(procedure_id: @procedure.id, accompagnateur_id: accompagnateur.id, to: 'not_assign')}", 'data-method' => 'put' }
|
%a.btn.btn-primary{ href: "#{admin_procedure_accompagnateurs_path(procedure_id: @procedure.id, accompagnateur_id: accompagnateur.id, to: Admin::AccompagnateursController::NOT_ASSIGN)}", 'data-method' => 'put' }
|
||||||
.fa.fa-arrow-left
|
.fa.fa-arrow-left
|
||||||
%td{ style: 'padding-top: 11px; font-size: 15px; text-align: right;' }= accompagnateur.email
|
%td{ style: 'padding-top: 11px; font-size: 15px; text-align: right;' }= accompagnateur.email
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
%tr
|
%tr
|
||||||
%td.col-xs-11{ style: 'padding-top: 11px; font-size: 15px;' }= accompagnateur.email
|
%td.col-xs-11{ style: 'padding-top: 11px; font-size: 15px;' }= accompagnateur.email
|
||||||
%td.center
|
%td.center
|
||||||
%a.btn.btn-success.gestionnaire-affectation{ href: "#{admin_procedure_accompagnateurs_path(procedure_id: @procedure.id, accompagnateur_id: accompagnateur.id, to: 'assign')}", 'data-method' => 'put' }
|
%a.btn.btn-success.gestionnaire-affectation{ href: "#{admin_procedure_accompagnateurs_path(procedure_id: @procedure.id, accompagnateur_id: accompagnateur.id, to: Admin::AccompagnateursController::ASSIGN)}", 'data-method' => 'put' }
|
||||||
.fa.fa-arrow-right
|
.fa.fa-arrow-right
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue