[fix #1829] Service: add breadcrumbs

This commit is contained in:
simon lehericey 2018-04-24 10:07:20 +02:00
parent 0cb910f38a
commit 0be21395ac
5 changed files with 29 additions and 5 deletions

View file

@ -6,6 +6,7 @@ module NewAdministrateur
end
def new
@procedure = procedure
end
def create
@ -23,6 +24,7 @@ module NewAdministrateur
def edit
@service = service
@procedure = procedure
end
def update

View file

@ -0,0 +1,5 @@
.sub-header
.container
%ul.breadcrumbs
- steps.each do |step|
%li= step

View file

@ -1,5 +1,11 @@
= render partial: 'new_administrateur/breadcrumbs',
locals: { steps: [link_to('Procedures', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
link_to('choix du service', services_path(procedure_id: @procedure.id)),
'modifier le service'] }
.container
%h1 Modifier le service
= render partial: 'form',
locals: { service: @service, procedure_id: params[:procedure_id] }
locals: { service: @service, procedure_id: @procedure.id }

View file

@ -1,3 +1,8 @@
= render partial: 'new_administrateur/breadcrumbs',
locals: { steps: [link_to('Procedures', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'choix du service'] }
#services-index.container
%h1 Choix du service pour la procédure
@ -19,7 +24,7 @@
%th
nom
%th.change
= link_to('Nouveau service', new_service_path(procedure_id: params[:procedure_id]), class: 'button')
= link_to('Nouveau service', new_service_path(procedure_id: @procedure.id), class: 'button')
%tbody
- @services.each do |service|
@ -27,8 +32,8 @@
%td
= service.nom
%td.change
= link_to('modifier', edit_service_path(service, procedure_id: params[:procedure_id]))
= link_to('modifier', edit_service_path(service, procedure_id: @procedure.id))
= link_to 'supprimer',
service_path(service, procedure_id: params[:procedure_id]),
service_path(service, procedure_id: @procedure.id),
method: :delete,
data: { confirm: "Confirmez vous la suppression de #{service.nom}" }

View file

@ -1,5 +1,11 @@
= render partial: 'new_administrateur/breadcrumbs',
locals: { steps: [link_to('Procedures', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
link_to('choix du service', services_path(procedure_id: @procedure.id)),
'nouveau service'] }
.container
%h1 Nouveau Service
= render partial: 'form',
locals: { service: Service.new, procedure_id: params[:procedure_id] }
locals: { service: Service.new, procedure_id: @procedure.id }