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

40 lines
1.4 KiB
Text
Raw Normal View History

2018-04-24 10:07:20 +02:00
= render partial: 'new_administrateur/breadcrumbs',
locals: { steps: [link_to('Procedures', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'choix du service'] }
2018-04-20 12:03:02 +02:00
#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'
2018-04-19 16:15:44 +02:00
%h1 Liste des Services
2018-04-19 18:12:48 +02:00
%table.table.table-service.hoverable
2018-04-19 16:15:44 +02:00
%thead
%tr
%th
nom
2018-04-19 18:12:48 +02:00
%th.change
2018-04-24 10:07:20 +02:00
= link_to('Nouveau service', new_service_path(procedure_id: @procedure.id), class: 'button')
2018-04-19 16:15:44 +02:00
%tbody
- @services.each do |service|
%tr
%td
= service.nom
2018-04-19 18:12:48 +02:00
%td.change
2018-04-24 10:07:20 +02:00
= link_to('modifier', edit_service_path(service, procedure_id: @procedure.id))
2018-04-23 15:32:27 +02:00
= link_to 'supprimer',
2018-04-24 10:07:20 +02:00
service_path(service, procedure_id: @procedure.id),
2018-04-23 15:32:27 +02:00
method: :delete,
data: { confirm: "Confirmez vous la suppression de #{service.nom}" }