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

23 lines
905 B
Text
Raw Normal View History

- dossier = Dossier.includes(:procedure).find_by(id: champ.value)
2017-03-28 15:09:03 +02:00
- show_procedure_libelle = dossier ? true : false
- show_warning = !show_procedure_libelle && champ.value.present?
- procedure_libelle = dossier.nil? ? '' : dossier.procedure.libelle
.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_procedure_libelle ? nil : 'display: none;' }
ce dossier répond à la procédure :
%br
%span.procedure-libelle= procedure_libelle
2017-03-28 15:09:03 +02:00
%p.text-warning{ style: show_warning ? nil : 'display: none;' }
Ce dossier est inconnu