demarches-normaliennes/app/views/new_administrateur/services/index.html.haml
2018-05-18 16:21:26 +02:00

39 lines
1.4 KiB
Text

= 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
= form_for @procedure, url: { controller: "new_administrateur/services", action: :add_to_procedure } , html: { class: 'form' } do |f|
= f.label :service_id, "La procédure #{@procedure.libelle} est affectée au service"
= f.select :service_id,
current_administrateur.services.map { |s| [ s.nom, s.id ] },
{ prompt: 'choisir un service', selected: @procedure.service&.id },
required: true
= f.hidden_field :id
= f.submit 'valider', class: 'button primary'
%h1 Liste des Services
%table.table.table-service.hoverable
%thead
%tr
%th
nom
%th.change
= link_to('Nouveau service', new_service_path(procedure_id: @procedure.id), class: 'button')
%tbody
- @services.each do |service|
%tr
%td
= service.nom
%td.change
= link_to('modifier', edit_service_path(service, procedure_id: @procedure.id))
= link_to 'supprimer',
service_path(service, procedure_id: @procedure.id),
method: :delete,
data: { confirm: "Confirmez vous la suppression de #{service.nom}" }