demarches-normaliennes/app/helpers/recovery_selection_helper.rb
2024-03-15 14:35:14 +01:00

16 lines
435 B
Ruby
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module RecoverySelectionHelper
def recoverable_id_and_libelles(recoverables)
recoverables
.map { |r| [r[:procedure_id], nice_libelle(r)] }
end
private
def nice_libelle(recoverable)
sanitize(
" #{number_with_html_delimiter(recoverable[:procedure_id])}" \
" - #{recoverable[:libelle]} " \
"#{tag.span(pluralize(recoverable[:count], 'dossier'), class: 'fr-tag fr-tag--sm')}"
)
end
end