More form tidy up

This commit is contained in:
Brenda Wallace
2019-04-27 19:19:42 +12:00
parent 45745a4e38
commit 9ecf210ffb
9 changed files with 25 additions and 27 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -11,7 +11,6 @@
#maincontainer
.row
.col-md-6
- if content_for?(:buttonbar)
= yield(:buttonbar)

View File

@@ -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

View File

@@ -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

View File

@@ -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