demarches-normaliennes/app/views/administrateurs/services/index.html.haml
Pierre de La Morinerie c0b96bfecb views: improve Service breadcrumbs
- Make the procedure name shorter
- Capitalize the words
2022-05-17 10:45:34 +02:00

39 lines
1.4 KiB
Text

= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)),
'Choix du service'] }
#services-index.container
%h1 Choix du service pour la démarche
= form_for @procedure, url: { controller: "administrateurs/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}" }