2021-11-25 16:26:55 +01:00
|
|
|
= render partial: 'administrateurs/breadcrumbs',
|
2018-11-27 16:20:55 +01:00
|
|
|
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
2022-05-11 12:19:48 +02:00
|
|
|
link_to(@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)),
|
|
|
|
'Choix du service'] }
|
2018-04-24 10:07:20 +02:00
|
|
|
|
2018-04-20 12:03:02 +02:00
|
|
|
#services-index.container
|
2018-09-05 14:48:42 +02:00
|
|
|
%h1 Choix du service pour la démarche
|
2018-04-20 12:03:02 +02:00
|
|
|
|
2021-11-25 16:26:55 +01:00
|
|
|
= form_for @procedure, url: { controller: "administrateurs/services", action: :add_to_procedure } , html: { class: 'form' } do |f|
|
2018-09-05 14:48:42 +02:00
|
|
|
= f.label :service_id, "La démarche #{@procedure.libelle} est affectée au service"
|
2018-04-20 12:03:02 +02:00
|
|
|
= f.select :service_id,
|
2019-03-06 17:06:54 +01:00
|
|
|
@services.map { |s| [ s.nom, s.id ] },
|
2018-04-20 12:03:02 +02:00
|
|
|
{ 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
|
2020-07-07 12:31:52 +02:00
|
|
|
= link_to('Nouveau service', new_admin_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
|
2020-07-07 12:31:52 +02:00
|
|
|
= link_to('modifier', edit_admin_service_path(service, procedure_id: @procedure.id))
|
2018-04-23 15:32:27 +02:00
|
|
|
= link_to 'supprimer',
|
2020-07-07 12:31:52 +02:00
|
|
|
admin_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}" }
|