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

45 lines
2 KiB
Text
Raw Normal View History

= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
2024-05-22 16:12:48 +02:00
['Service']] }
2018-04-24 10:07:20 +02:00
2024-05-22 16:12:48 +02:00
#services-index.fr-container
%h1.fr-h2 Service
2018-04-19 16:15:44 +02:00
2024-10-18 11:29:29 +02:00
= link_to "Nouveau service", new_admin_service_path(procedure_id: @procedure.id), class: "fr-btn fr-btn--primary fr-btn--icon-left fr-icon-add-circle-line mb-3"
2024-05-22 16:12:48 +02:00
.fr-table.fr-table--layout-fixed
%table
%caption Liste des services pouvant être affectés à la démarche
%thead
2018-04-19 16:15:44 +02:00
%tr
2024-05-22 16:12:48 +02:00
%th{ scope: "col" }
Nom
2024-10-18 11:29:29 +02:00
%th.fr-col-4{ scope: "col" }
Actions
2024-05-22 16:12:48 +02:00
%tbody
- @services.each do |service|
%tr
%td
= service.nom
2024-10-18 11:29:29 +02:00
%td.fr-col-4
.fr-container.flex.px-0
.fr-col-4.fr-col--middle
- if @procedure.service == service
%p.fr-badge.fr-badge--success.fr-badge--sm
ASSIGNÉ
- else
= button_to "Assigner", add_to_procedure_admin_services_path(procedure: { id: @procedure.id, service_id: service.id, }), method: :patch, class: 'fr-btn fr-btn--sm fr-btn--secondary fr-btn--icon-left fr-icon-checkbox-circle-line'
.fr-col-4
= link_to('Modifier', edit_admin_service_path(service, procedure_id: @procedure.id), class: 'fr-btn fr-btn--sm fr-btn--secondary fr-btn--icon-left fr-icon-pencil-line')
.fr-col-4
= button_to 'Supprimer',
admin_service_path(service, procedure_id: @procedure.id),
method: :delete,
data: { confirm: "Confirmez vous la suppression de #{service.nom}" },
class: 'fr-btn fr-btn--sm fr-btn--secondary fr-btn--icon-left fr-icon-delete-line',
disabled: (@procedure.service == service)
2024-05-22 16:12:48 +02:00
2024-05-27 17:56:05 +02:00
= render Procedure::FixedFooterComponent.new(procedure: @procedure)