From 9ecf210ffb41bf48fc246eecbd29f1daab276635 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 27 Apr 2019 19:19:42 +1200 Subject: [PATCH] More form tidy up --- app/views/alternate_names/_form.html.haml | 1 - app/views/comments/_form.html.haml | 44 +++++++++++++---------- app/views/crops/_form.html.haml | 1 - app/views/gardens/_form.html.haml | 1 - app/views/harvests/_form.html.haml | 1 - app/views/layouts/application.html.haml | 1 - app/views/plantings/_form.html.haml | 1 - app/views/posts/_form.html.haml | 1 - app/views/seeds/_form.html.haml | 1 - 9 files changed, 25 insertions(+), 27 deletions(-) diff --git a/app/views/alternate_names/_form.html.haml b/app/views/alternate_names/_form.html.haml index 879dc2b54..6c9bbf283 100644 --- a/app/views/alternate_names/_form.html.haml +++ b/app/views/alternate_names/_form.html.haml @@ -1,5 +1,4 @@ .card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2 - / Naked Form .card-body - if content_for? :title %h1.h2-responsive.text-center diff --git a/app/views/comments/_form.html.haml b/app/views/comments/_form.html.haml index 047060b15..676d7f4fb 100644 --- a/app/views/comments/_form.html.haml +++ b/app/views/comments/_form.html.haml @@ -1,20 +1,26 @@ -= form_for(@comment, html: { class: "form-horizontal", role: "form" }) do |f| - - if @comment.errors.any? - #error_explanation - %h2 - = pluralize(@comment.errors.size, "error") - prohibited this comment from being saved: - %ul - - @comment.errors.full_messages.each do |msg| - %li= msg +.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2 + .card-body + - if content_for? :title + %h1.h2-responsive.text-center + %strong=yield :title + = form_for(@comment, html: { class: "form-horizontal", role: "form" }) do |f| + - if @comment.errors.any? + #error_explanation + %h2 + = pluralize(@comment.errors.size, "error") + prohibited this comment from being saved: + %ul + - @comment.errors.full_messages.each do |msg| + %li= msg - .form-group - = f.label :body, "Your comment:" - = f.text_area :body, rows: 6, class: 'form-control', autofocus: 'autofocus' - %span.help-block - = render partial: "shared/markdown_help" - .actions - = f.submit 'Post comment', class: 'btn btn-primary' - - if defined?(@post) - .field - = f.hidden_field :post_id, value: @post.id + .md-form + = f.text_area :body, rows: 6, class: 'form-control md-textarea', autofocus: 'autofocus' + = f.label :body, "Your comment:" + + %span.help-block + = render partial: "shared/markdown_help" + .actions.pull-right + = f.submit 'Post comment', class: 'btn btn-primary' + - if defined?(@post) + .field + = f.hidden_field :post_id, value: @post.id diff --git a/app/views/crops/_form.html.haml b/app/views/crops/_form.html.haml index e95791797..5ae0b586b 100644 --- a/app/views/crops/_form.html.haml +++ b/app/views/crops/_form.html.haml @@ -1,5 +1,4 @@ .card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2 - / Naked Form .card-body - if content_for? :title %h1.h2-responsive.text-center diff --git a/app/views/gardens/_form.html.haml b/app/views/gardens/_form.html.haml index ac2be11e4..3e14520d3 100644 --- a/app/views/gardens/_form.html.haml +++ b/app/views/gardens/_form.html.haml @@ -1,5 +1,4 @@ .card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2 - / Naked Form .card-body - if content_for? :title %h1.h2-responsive.text-center diff --git a/app/views/harvests/_form.html.haml b/app/views/harvests/_form.html.haml index 5a4aa2b0d..c1e5af31f 100644 --- a/app/views/harvests/_form.html.haml +++ b/app/views/harvests/_form.html.haml @@ -1,5 +1,4 @@ .card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2 - / Naked Form .card-body - if content_for? :title %h1.h2-responsive.text-center diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index f081d970c..42b6af851 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -11,7 +11,6 @@ #maincontainer .row .col-md-6 - - if content_for?(:buttonbar) = yield(:buttonbar) diff --git a/app/views/plantings/_form.html.haml b/app/views/plantings/_form.html.haml index 3ba54e619..d7cadf83d 100644 --- a/app/views/plantings/_form.html.haml +++ b/app/views/plantings/_form.html.haml @@ -1,5 +1,4 @@ .card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2 - / Naked Form .card-body - if content_for? :title %h1.h2-responsive.text-center diff --git a/app/views/posts/_form.html.haml b/app/views/posts/_form.html.haml index 14392c78c..aa115588a 100644 --- a/app/views/posts/_form.html.haml +++ b/app/views/posts/_form.html.haml @@ -1,5 +1,4 @@ .card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2 - / Naked Form .card-body - if content_for? :title %h1.h2-responsive.text-center diff --git a/app/views/seeds/_form.html.haml b/app/views/seeds/_form.html.haml index 9462023d7..3746c0725 100644 --- a/app/views/seeds/_form.html.haml +++ b/app/views/seeds/_form.html.haml @@ -1,5 +1,4 @@ .card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2 - / Naked Form .card-body - if content_for? :title %h1.h2-responsive.text-center