From 5c39f22417f6c6bded08ef81aeb98625e9593b7d Mon Sep 17 00:00:00 2001 From: clemkeirua Date: Wed, 24 Jun 2020 09:33:55 +0200 Subject: [PATCH] =?UTF-8?q?seuil=20d'affichages=20des=20checbox/radio=20?= =?UTF-8?q?=C3=A0=205=20elements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/champs/drop_down_list_champ.rb | 2 +- app/models/champs/multiple_drop_down_list_champ.rb | 2 +- .../dossiers/editable_champs/_multiple_drop_down_list.html.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/champs/drop_down_list_champ.rb b/app/models/champs/drop_down_list_champ.rb index 3fdbe8120..c32ff39fc 100644 --- a/app/models/champs/drop_down_list_champ.rb +++ b/app/models/champs/drop_down_list_champ.rb @@ -1,3 +1,3 @@ class Champs::DropDownListChamp < Champ - THRESHOLD_NB_OPTIONS_AS_RADIO = 3 + THRESHOLD_NB_OPTIONS_AS_RADIO = 5 end diff --git a/app/models/champs/multiple_drop_down_list_champ.rb b/app/models/champs/multiple_drop_down_list_champ.rb index efd695631..738db3a07 100644 --- a/app/models/champs/multiple_drop_down_list_champ.rb +++ b/app/models/champs/multiple_drop_down_list_champ.rb @@ -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 diff --git a/app/views/shared/dossiers/editable_champs/_multiple_drop_down_list.html.haml b/app/views/shared/dossiers/editable_champs/_multiple_drop_down_list.html.haml index 56000873d..978ea8e70 100644 --- a/app/views/shared/dossiers/editable_champs/_multiple_drop_down_list.html.haml +++ b/app/views/shared/dossiers/editable_champs/_multiple_drop_down_list.html.haml @@ -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,