mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-09-25 07:24:55 -04:00
The label-beside-input forms (label col-md-2, input col-md-8) relied on form-horizontal and form-group acting as a row. Each field wrapper is now a real .row.mb-3, labels are col-form-label, help text is form-text, and the leftover form-horizontal and form-actions classes, which do nothing in Bootstrap 5, are dropped. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2
|
|
= bootstrap_form_for(@post) do |f|
|
|
.card-header
|
|
- if content_for? :title
|
|
%h1.h2-responsive.text-center
|
|
%strong=yield :title
|
|
- if @post.errors.any?
|
|
#error_explanation
|
|
%h2
|
|
= pluralize(@post.errors.size, "error")
|
|
prohibited this post from being saved:
|
|
%ul
|
|
- @post.errors.full_messages.each do |msg|
|
|
%li= msg
|
|
|
|
.card-body
|
|
= f.text_field :subject, autofocus: 'autofocus', maxlength: 255
|
|
|
|
- if @post.forum || @forum
|
|
= label_tag :body, "What's up?"
|
|
- else
|
|
= label_tag :body, "What's going on in your food garden?"
|
|
= f.text_area :body, rows: 12
|
|
%span.form-text= render partial: "shared/markdown_help"
|
|
|
|
- if @post.forum || @forum
|
|
- forum = @post.forum || @forum
|
|
%p
|
|
This post will be posted in the forum
|
|
= link_to forum.name, forum
|
|
.field
|
|
= f.hidden_field :forum_id, value: forum.id
|
|
.card-footer
|
|
.text-end= f.submit "Post"
|