mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-31 03:09:06 -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>
34 lines
1.2 KiB
Plaintext
34 lines
1.2 KiB
Plaintext
= form_for @scientific_name do |f|
|
|
- if @scientific_name.errors.any?
|
|
#error_explanation
|
|
%h2
|
|
= pluralize(@scientific_name.errors.size, "error")
|
|
prohibited this scientific_name from being saved:
|
|
%ul
|
|
- @scientific_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(:scientific_name, :crop_id, Crop.order(:name).pluck(:name, :id),
|
|
{ selected: @scientific_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'
|
|
.row.mb-3
|
|
= f.label :wikidata_id, "Wikidata ID", class: 'col-form-label col-md-2'
|
|
.col-md-8
|
|
= f.text_field :wikidata_id, class: 'form-control', pattern: 'Q[1-9][0-9]*'
|
|
.row.mb-3
|
|
.offset-md-2.col-md-8
|
|
= f.submit 'Save', class: 'btn btn-primary'
|