adapt button icons to bulk action

This commit is contained in:
Lisa Durand 2022-12-12 10:28:23 +01:00 committed by mfo
parent 89730b485b
commit ff7c1fef65
2 changed files with 8 additions and 1 deletions

View file

@ -21,4 +21,11 @@ class Dossiers::BatchOperationComponent < ApplicationComponent
end
options
end
def icons
{
archiver: 'fr-icon-folder-2-line',
passer_en_instruction: 'fr-icon-edit-line'
}
end
end

View file

@ -1,4 +1,4 @@
= form_for(BatchOperation.new, url: instructeur_batch_operations_path(procedure_id: procedure.id), method: :post, id: dom_id(BatchOperation.new), html: { class: 'flex justify-end' }, data: { "batch-operation-target" => "form"}) do |form|
.flex.align-center
- available_operations.each do |opt|
= form.button opt[0], class: "fr-btn fr-btn--icon-left fr-icon-folder-2-line", disabled: :disabled, name: "#{form.object_name}[operation]", data: { "batch-operation-target" => "submit", "submitter-operation" => opt[1]}
= form.button opt[0], class: ['fr-btn fr-btn--icon-left', icons[opt[1].to_sym]], disabled: :disabled, name: "#{form.object_name}[operation]", data: { "batch-operation-target" => "submit", "submitter-operation" => opt[1]}