Files
growstuff/app/views/gardens/_form.html.haml
T
Brenda WallaceandClaude Sonnet 5 92f3f0cc36 Convert Bootstrap 3 horizontal forms to Bootstrap 5
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>
2026-09-20 18:03:36 +12:00

40 lines
1.9 KiB
Plaintext

.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2
= bootstrap_form_for(@garden) do |f|
- if content_for? :title
.card-header
%h1.h2-responsive.text-center
%strong=yield :title
.card-body
- if @garden.errors.any?
#error_explanation.alert.alert-warning{:role => "alert"}
%h4.alert-heading
= pluralize(@garden.errors.size, "error")
prohibited this garden from being saved
%ul
- @garden.errors.full_messages.each do |msg|
%li= msg
= f.text_field :name, maxlength: 255, required: true
= f.text_area :description, rows: 6, placeholder: "Tell us about this garden - where is it located? What does it look like? Do you have a link to a photo? Do you have irrigation? What are your plans?"
= f.text_field :location,
value: @garden.location || current_member.location,
class: 'form-control', maxlength: 255
%span.form-text
= t('.location_helper')
- if current_member.location.blank?
= link_to "Set your location now.", edit_member_registration_path
- else
= link_to "Change your location.", edit_member_registration_path
.row
.col-md-5.col-12= f.number_field :area, class: 'input-small', step: "any", min: 0
.col-md-7.col-12= f.select(:area_unit, Garden::AREA_UNITS_VALUES, { include_blank: false })
.col-12= f.select(:garden_type_id, GardenType.all.order(:name).pluck(:name, :id),
selected: @garden.garden_type_id, include_blank: true)
.col-12
= f.check_box :active, label: 'Active?'
%p
You can mark a garden as inactive if you no longer use it.
Note: this will mark all plantings in the garden as "finished".
.card-footer
.text-end= f.submit 'Save Garden'