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

44 lines
1.5 KiB
Text
Raw Normal View History

- content_for :title, "Labels"
2024-10-16 14:31:08 +02:00
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
['Labels']] }
.fr-container
%h1.fr-h2 Labels
= link_to "Nouveau label",
[:new, :admin, @procedure, :procedure_label],
class: "fr-btn fr-btn--primary fr-btn--icon-left fr-icon-add-circle-line mb-3"
2024-10-16 14:31:08 +02:00
- if @procedure.procedure_labels.present?
.fr-table.fr-table--layout-fixed.fr-table--bordered
%table
%caption Liste des labels
%thead
%tr
%th{ scope: "col" }
Nom
%th.change{ scope: "col" }
Actions
%tbody
- @labels.each do |label|
%tr
%td
= tag_label(label.name, label.color)
%td.change
= link_to 'Modifier',
[:edit, :admin, @procedure, label],
class: 'fr-btn fr-btn--sm fr-btn--secondary fr-btn--icon-left fr-icon-pencil-line'
2024-10-16 14:31:08 +02:00
= link_to 'Supprimer',
[:admin, @procedure, label],
2024-10-16 14:31:08 +02:00
method: :delete,
data: { confirm: "Confirmez vous la suppression de #{label.name}" },
class: 'fr-btn fr-btn--sm fr-btn--secondary fr-btn--icon-left fr-icon-delete-line fr-ml-1w'
= render Procedure::FixedFooterComponent.new(procedure: @procedure)