demarches-normaliennes/app/views/users/description/champs/_dossier_link.html.haml
gregoirenovel 6bb67d639c Use lowercase letters and dashes for CSS classes
As enforced by scss-lint
2017-04-25 15:59:03 +02:00

22 lines
877 B
Text

- dossier = Dossier.find_by(id: champ.value)
- 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: champ.libelle,
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
%p.text-warning{ style: show_warning ? nil : 'display: none;' }
Ce dossier est inconnu