demarches-normaliennes/app/views/administrateurs/labels/_form.html.haml

16 lines
805 B
Text
Raw Normal View History

= form_with model: label, url: [:admin, @procedure, @label], local: true do |f|
2024-10-29 15:39:58 +01:00
= render Dsfr::InputComponent.new(form: f, attribute: :name, input_type: :text_field, opts: { maxlength: Label::NAME_MAX_LENGTH})
%fieldset.fr-fieldset
%legend.fr-fieldset__legend.fr-fieldset__legend--regular
2024-10-29 15:39:58 +01:00
= t('activerecord.attributes.label.color')
= asterisk
- @colors_collection.each do |color|
.fr-fieldset__element.fr-fieldset__element--inline
.fr-radio-group
= f.radio_button :color, color, checked: (label.color == color)
2024-10-29 15:39:58 +01:00
= f.label :color, t("activerecord.attributes.label/color.#{color}"), value: color, class: "fr-label fr-tag fr-tag--sm fr-tag--#{Label.class_name(color)}"
2024-10-16 14:31:08 +02:00
= render Procedure::FixedFooterComponent.new(procedure: @procedure, form: f)