demarches-normaliennes/app/views/new_administrateur/services/index.html.haml

39 lines
1.4 KiB
Text

= render partial: 'new_administrateur/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'choix du service'] }
#services-index.container
%h1 Choix du service pour la démarche
= form_for @procedure, url: { controller: "new_administrateur/services", action: :add_to_procedure } , html: { class: 'form' } do |f|
= f.label :service_id, "La démarche #{@procedure.libelle} est affectée au service"
= f.select :service_id,
@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_admin_service_path(procedure_id: @procedure.id), class: 'button')
%tbody
- @services.each do |service|
%tr
%td
= service.nom
%td.change
= link_to('modifier', edit_admin_service_path(service, procedure_id: @procedure.id))
= link_to 'supprimer',
admin_service_path(service, procedure_id: @procedure.id),
method: :delete,
data: { confirm: "Confirmez vous la suppression de #{service.nom}" }