Use champ decorator to print dossier details
This commit is contained in:
parent
47857664eb
commit
8aed0d7aef
3 changed files with 7 additions and 6 deletions
|
@ -6,6 +6,12 @@ class ChampDecorator < Draper::Decorator
|
|||
Date.parse(object.value).strftime("%d/%m/%Y")
|
||||
elsif type_champ == 'checkbox'
|
||||
object.value == 'on' ? 'Oui' : 'Non'
|
||||
elsif type_champ == 'yes_no'
|
||||
if object.value == 'true'
|
||||
'Oui'
|
||||
elsif object.value == 'false'
|
||||
'Non'
|
||||
end
|
||||
elsif type_champ == 'multiple_drop_down_list' && object.value.present?
|
||||
JSON.parse(object.value).join(', ')
|
||||
else
|
||||
|
|
|
@ -46,11 +46,6 @@
|
|||
= dossier.text_summary
|
||||
- else
|
||||
Pas de dossier associé
|
||||
- elsif champ.type_champ == 'yes_no'
|
||||
- if champ.decorate.value == 'true'
|
||||
Oui
|
||||
- elsif champ.decorate.value == 'false'
|
||||
Non
|
||||
- else
|
||||
= sanitize(champ.decorate.value)
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
- if @dossier.champs.present? && @dossier.champs.any?
|
||||
%table.table
|
||||
%tbody
|
||||
- @dossier.champs.each do |c|
|
||||
- @dossier.champs.decorate.each do |c|
|
||||
%tr
|
||||
%th
|
||||
= "#{c.libelle} :"
|
||||
|
|
Loading…
Reference in a new issue