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

34 lines
1.2 KiB
Text

#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: params[:procedure_id]), class: 'button')
%tbody
- @services.each do |service|
%tr
%td
= service.nom
%td.change
= link_to('modifier', edit_service_path(service, procedure_id: params[:procedure_id]))
= link_to 'supprimer',
service_path(service, procedure_id: params[:procedure_id]),
method: :delete,
data: { confirm: "Confirmez vous la suppression de #{service.nom}" }