[Fix #3572] Use champ with correct type for balise
This commit is contained in:
parent
739ddf3f7c
commit
610d2e7e2b
2 changed files with 8 additions and 8 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue