seuil d'affichages des checbox/radio à 5 elements

This commit is contained in:
clemkeirua 2020-06-24 09:33:55 +02:00
parent 342129c893
commit 5c39f22417
3 changed files with 3 additions and 3 deletions

View file

@ -1,3 +1,3 @@
class Champs::DropDownListChamp < Champ
THRESHOLD_NB_OPTIONS_AS_RADIO = 3
THRESHOLD_NB_OPTIONS_AS_RADIO = 5
end

View file

@ -1,7 +1,7 @@
class Champs::MultipleDropDownListChamp < Champ
before_save :format_before_save
THRESHOLD_NB_OPTIONS_AS_RADIO = 3
THRESHOLD_NB_OPTIONS_AS_CHECKBOX = 5
def search_terms
selected_options

View file

@ -1,6 +1,6 @@
- if champ.drop_down_list && champ.drop_down_list.options.any?
- enabled_non_empty_options = champ.drop_down_list.enabled_non_empty_options
- if enabled_non_empty_options.size > Champs::MultipleDropDownListChamp::THRESHOLD_NB_OPTIONS_AS_RADIO
- if enabled_non_empty_options.size > Champs::MultipleDropDownListChamp::THRESHOLD_NB_OPTIONS_AS_CHECKBOX
= form.select :value,
champ.drop_down_list.options,
{ selected: champ.selected_options,