2017-04-26 16:15:48 +02:00
|
|
|
- dossier = Dossier.find_by(id: champ.value)
|
|
|
|
- show_text_summary = dossier.present?
|
|
|
|
- show_warning = !show_text_summary && champ.value.present?
|
|
|
|
- text_summary = dossier.try(:text_summary)
|
2017-03-28 15:09:03 +02:00
|
|
|
|
|
|
|
.dossier-link
|
|
|
|
%input.form-control{ name: "champs['#{ champ.id }']",
|
2017-04-17 17:15:44 +02:00
|
|
|
placeholder: "Numéro de dossier",
|
2017-03-28 15:09:03 +02:00
|
|
|
id: "champs_#{ champ.id }",
|
|
|
|
value: champ.value,
|
|
|
|
type: 'number',
|
|
|
|
'autocomplete' => 'off',
|
|
|
|
'data-type' => 'dossier-link' }
|
|
|
|
|
|
|
|
.help-block
|
2017-04-26 16:15:48 +02:00
|
|
|
%p.text-info{ style: show_text_summary ? nil : 'display: none;' }
|
|
|
|
%span.dossier-text-summary= text_summary
|
2017-04-18 17:19:40 +02:00
|
|
|
|
2017-03-28 15:09:03 +02:00
|
|
|
%p.text-warning{ style: show_warning ? nil : 'display: none;' }
|
2017-04-24 10:12:02 +02:00
|
|
|
Ce dossier est inconnu
|