Form: add description
This commit is contained in:
parent
d4bbcdf682
commit
46c144146c
3 changed files with 16 additions and 4 deletions
|
@ -8,8 +8,15 @@
|
|||
}
|
||||
|
||||
label {
|
||||
margin-bottom: $default-spacer;
|
||||
display: inline-block;
|
||||
margin-bottom: $default-padding;
|
||||
display: block;
|
||||
|
||||
.notice {
|
||||
font-size: 14px;
|
||||
display: block;
|
||||
margin-top: $default-spacer;
|
||||
color: $grey;
|
||||
}
|
||||
}
|
||||
|
||||
input[type=text]:not([data-address='true']),
|
||||
|
|
|
@ -32,8 +32,10 @@ class RootController < ApplicationController
|
|||
end
|
||||
|
||||
def patron
|
||||
description = 'a not so long description'
|
||||
|
||||
all_champs = TypeDeChamp.type_champs
|
||||
.map { |name, _| TypeDeChamp.new(type_champ: name, libelle: name, mandatory: true) }
|
||||
.map { |name, _| TypeDeChamp.new(type_champ: name, libelle: name, description: description, mandatory: true) }
|
||||
.map { |type_de_champ| ChampPublic.new(type_de_champ: type_de_champ) }
|
||||
.map.with_index do |champ, i|
|
||||
champ.id = i
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
= form.label :value, "#{champ.libelle} #{champ.mandatory ? '*' : nil}"
|
||||
= form.label :value do
|
||||
#{champ.libelle} #{champ.mandatory ? '*' : nil}
|
||||
- if champ.description.present?
|
||||
%span.notice= champ.description
|
||||
|
|
Loading…
Reference in a new issue