mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-30 18:58:39 -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>
39 lines
1.5 KiB
Plaintext
39 lines
1.5 KiB
Plaintext
.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 @alternate_name do |f|
|
|
- if @alternate_name.errors.any?
|
|
#error_explanation
|
|
%h2
|
|
= pluralize(@alternate_name.errors.size, "error")
|
|
prohibited this alternate_name from being saved:
|
|
%ul
|
|
- @alternate_name.errors.full_messages.each do |msg|
|
|
%li= msg
|
|
|
|
%p
|
|
%span.form-text
|
|
For detailed crop wrangling guidelines, please consult the
|
|
= link_to "crop wrangling guide", "https://github.com/Growstuff/growstuff/wiki/Crop-Wrangling"
|
|
on the Growstuff wiki.
|
|
|
|
.row.mb-3
|
|
= f.label :crop_id, class: 'col-form-label col-md-2'
|
|
.col-md-8
|
|
= select(:alternate_name, :crop_id,
|
|
Crop.order(:name).pluck(:name, :id),
|
|
{ selected: @alternate_name.crop_id || @crop.id },
|
|
class: 'form-control')
|
|
|
|
.row.mb-3
|
|
= f.label :name, class: 'col-form-label col-md-2'
|
|
.col-md-8
|
|
= f.text_field :name, class: 'form-control'
|
|
.col-md-8
|
|
= f.select :language, I18nData.languages.map {|code, name| [name.split(";").first, code] }, class: 'form-control'
|
|
.row.mb-3
|
|
.offset-md-2.col-md-8
|
|
= f.submit 'Save', class: 'btn btn-primary'
|