demarches-normaliennes/app/views/users/description/champs/_dossier_link.html.haml

21 lines
783 B
Text
Raw Normal View History

- 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 }']",
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
%p.text-info{ style: show_text_summary ? nil : 'display: none;' }
%span.dossier-text-summary= text_summary
2017-03-28 15:09:03 +02:00
%p.text-warning{ style: show_warning ? nil : 'display: none;' }
Ce dossier est inconnu