demarches-normaliennes/app/views/users/description/champs/_dossier_link.html.haml
2018-05-31 11:49:25 +02:00

20 lines
778 B
Text

- dossier = Dossier.find_by(id: champ.value)
- show_text_summary = dossier.present?
- show_warning = !show_text_summary && champ.value.present?
- text_summary = dossier&.text_summary
.dossier-link
%input.form-control{ name: "champs['#{ champ.id }']",
placeholder: "Numéro de dossier",
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
%p.text-warning{ style: show_warning ? nil : 'display: none;' }
Ce dossier est inconnu