[Fix #3572] Use champ with correct type for balise

This commit is contained in:
Frederic Merizen 2019-03-08 12:51:08 +01:00
parent 739ddf3f7c
commit 610d2e7e2b
2 changed files with 8 additions and 8 deletions

View file

@ -23,25 +23,25 @@ class TypesDeChamp::LinkedDropDownListTypeDeChamp < TypesDeChamp::TypeDeChampBas
def tags_for_template
tags = super
l = libelle
tdc = @type_de_champ
tags.push(
{
libelle: "#{l}/primaire",
libelle: "#{libelle}/primaire",
description: "#{description} (menu primaire)",
lambda: -> (champs) {
champs
.detect { |champ| champ.libelle == l }
.detect { |champ| champ.type_de_champ == tdc }
&.primary_value
}
}
)
tags.push(
{
libelle: "#{l}/secondaire",
libelle: "#{libelle}/secondaire",
description: "#{description} (menu secondaire)",
lambda: -> (champs) {
champs
.detect { |champ| champ.libelle == l }
.detect { |champ| champ.type_de_champ == tdc }
&.secondary_value
}
}

View file

@ -8,13 +8,13 @@ class TypesDeChamp::TypeDeChampBase
end
def tags_for_template
l = libelle
tdc = @type_de_champ
[
{
libelle: l,
libelle: libelle,
description: description,
lambda: -> (champs) {
champs.detect { |champ| champ.libelle == l }
champs.detect { |champ| champ.type_de_champ == tdc }
}
}
]