diff options
| author | Alban Peignier | 2016-11-22 19:10:33 +0100 |
|---|---|---|
| committer | Alban Peignier | 2016-11-28 11:02:34 +0100 |
| commit | 7353dcd212d3cc3eba1fee08dad7d12d7fcf5d29 (patch) | |
| tree | e2da8a1df770d3ef467c5789e1973a66c02f4c67 | |
| parent | c9ca6816bdb106279a32706eb7dc325d5864d3a0 (diff) | |
| download | chouette-core-7353dcd212d3cc3eba1fee08dad7d12d7fcf5d29.tar.bz2 | |
Move period error display in nested-fields. Refs #2035
| -rw-r--r-- | app/views/referentials/_form.html.slim | 7 | ||||
| -rw-r--r-- | app/views/referentials/_period_fields.html.slim | 23 |
2 files changed, 15 insertions, 15 deletions
diff --git a/app/views/referentials/_form.html.slim b/app/views/referentials/_form.html.slim index 06c0bff23..6f4b862b5 100644 --- a/app/views/referentials/_form.html.slim +++ b/app/views/referentials/_form.html.slim @@ -67,13 +67,6 @@ = form.simple_fields_for :metadatas do |subform| = subform.simple_fields_for :periods do |period_form| - - if period_form.object.errors.has_key? :base - .row - .col-lg-12 - .alert.alert-danger - - period_form.object.errors[:base].each do |message| - p.small = message - .row = render 'period_fields', f: period_form diff --git a/app/views/referentials/_period_fields.html.slim b/app/views/referentials/_period_fields.html.slim index 5ab5be54b..9d92f92ce 100644 --- a/app/views/referentials/_period_fields.html.slim +++ b/app/views/referentials/_period_fields.html.slim @@ -1,9 +1,16 @@ .nested-fields - .col-lg-5.col-md-5.col-sm-5.col-xs-5 - = f.input :begin, as: :date, html5: true, input_html: { style: 'width: 100%' } - .col-lg-5.col-md-5.col-sm-5.col-xs-5 - = f.input :end, as: :date, html5: true, input_html: { style: 'width: 100%' } - - .col-lg-2.col-md-2.col-sm-2.col-xs-2.text-right style='margin-top:23px' - = link_to_remove_association f, class: 'btn btn-danger', data: { confirm: 'Etes-vous sûr(e) ?' } do - span.fa.fa-trash + - if f.object.errors.has_key? :base + .row + .col-lg-12 + .alert.alert-danger + - f.object.errors[:base].each do |message| + p.small = message + .row + .col-lg-5.col-md-5.col-sm-5.col-xs-5 + = f.input :begin, as: :date, html5: true, input_html: { style: 'width: 100%' } + .col-lg-5.col-md-5.col-sm-5.col-xs-5 + = f.input :end, as: :date, html5: true, input_html: { style: 'width: 100%' } + + .col-lg-2.col-md-2.col-sm-2.col-xs-2.text-right style='margin-top:23px' + = link_to_remove_association f, class: 'btn btn-danger', data: { confirm: 'Etes-vous sûr(e) ?' } do + span.fa.fa-trash |
