[#3356] Let types de champ decide their tags
This commit is contained in:
parent
d67af741d5
commit
bcfc0f2535
2 changed files with 13 additions and 8 deletions
|
@ -167,15 +167,11 @@ module TagsSubstitutionConcern
|
|||
end
|
||||
|
||||
def types_de_champ_tags(types_de_champ, available_for_states)
|
||||
types_de_champ.flat_map do |tdc|
|
||||
[
|
||||
{
|
||||
libelle: tdc.libelle,
|
||||
description: tdc.description,
|
||||
available_for_states: available_for_states
|
||||
}
|
||||
]
|
||||
tags = types_de_champ.flat_map(&:tags_for_template)
|
||||
tags.each do |tag|
|
||||
tag[:available_for_states] = available_for_states
|
||||
end
|
||||
tags
|
||||
end
|
||||
|
||||
def replace_tags(text, dossier)
|
||||
|
|
|
@ -174,6 +174,15 @@ class TypeDeChamp < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
def tags_for_template
|
||||
[
|
||||
{
|
||||
libelle: libelle,
|
||||
description: description
|
||||
}
|
||||
]
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def setup_procedure
|
||||
|
|
Loading…
Reference in a new issue