mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-26 02:33:03 -04:00
* Add seed source to Seed model * Update _form.html.haml * Add to schema * Default option * Default option * Fix test --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
77 lines
3.4 KiB
Plaintext
77 lines
3.4 KiB
Plaintext
.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2
|
|
= bootstrap_form_for(@seed) do |f|
|
|
.card-header
|
|
- if content_for? :title
|
|
%h1.h2-responsive.text-center
|
|
= seed_icon
|
|
%strong=yield :title
|
|
.card-body
|
|
- if @seed.errors.any?
|
|
#error_explanation
|
|
%h2
|
|
= pluralize(@seed.errors.size, "error")
|
|
prohibited this seed from being saved:
|
|
%ul
|
|
- @seed.errors.full_messages.each do |msg|
|
|
%li= msg
|
|
|
|
.form-group.required
|
|
= f.label :crop, 'Crop'
|
|
- if @planting
|
|
= link_to @planting, planting_path(@planting)
|
|
= f.hidden_field :parent_planting_id, value: @planting.id
|
|
- else
|
|
|
|
= auto_suggest @seed, :crop, class: 'form-control', default: @crop, required: true
|
|
%span.help-inline
|
|
Can't find what you're looking for?
|
|
= link_to "Request new crops.", new_crop_path
|
|
.row
|
|
.col-12.col-md-4
|
|
= f.text_field :saved_at,
|
|
value: @seed.saved_at ? @seed.saved_at.to_fs(:ymd) : '',
|
|
class: 'add-datepicker', label: 'When were the seeds harvested/saved?'
|
|
.col-12.col-md-4= f.number_field :quantity, label: 'Quantity', min: 1
|
|
.col-12.col-md-4
|
|
= f.text_field :plant_before, class: 'add-datepicker',
|
|
value: @seed.plant_before ? @seed.plant_before.to_fs(:ymd) : ''
|
|
|
|
.row
|
|
.col-12.col-md-4
|
|
= f.check_box :finished, label: t('buttons.mark_as_finished')
|
|
.col-12.col-md-4
|
|
= f.text_field :finished_at, class: 'add-datepicker', value: @seed.finished_at ? @seed.finished_at.to_fs(:ymd) : ''
|
|
.col-12.col-md-4
|
|
%span.help-inline= t('.finish_helper')
|
|
|
|
.row
|
|
.col-md-6= f.number_field :days_until_maturity_min, label_as_placeholder: true, label: 'min', prepend: 'Days until maturity', min: 1
|
|
.col-md-6= f.number_field :days_until_maturity_max, label_as_placeholder: true, label: 'max', prepend: 'to', append: "days", min: 1
|
|
|
|
.row
|
|
.col-md-3
|
|
= f.select(:organic, Seed::ORGANIC_VALUES, { label: 'Organic?', wrapper: { class: 'required' }, required: true }, default: 'unknown')
|
|
.col-md-3
|
|
= f.select(:gmo, Seed::GMO_VALUES, { label: 'GMO?', wrapper: { class: 'required' }, required: true }, default: 'unknown')
|
|
.col-md-3
|
|
= f.select(:heirloom, Seed::HEIRLOOM_VALUES, { label: 'Heirloom?', wrapper: { class: 'required' }, required: true }, default: 'unknown')
|
|
.col-md-3
|
|
= f.select(:source, Seed::SOURCE_VALUES, { label: 'Source?', wrapper: { class: 'required' }, required: true }, default: 'unknown')
|
|
= f.text_area :description, rows: 6
|
|
|
|
%hr/
|
|
= t('.trade_help', site_name: ENV['GROWSTUFF_SITE_NAME'])
|
|
= f.select(:tradable_to, Seed::TRADABLE_TO_VALUES, { label: 'Will trade', wrapper: { class: 'required' }, required: true })
|
|
%span.help_inline
|
|
- if current_member.location.blank?
|
|
Don't forget to
|
|
= succeed "." do
|
|
= link_to "set your location", edit_member_registration_path
|
|
- else
|
|
from
|
|
= succeed "." do
|
|
= link_to current_member.location, place_path(current_member.location)
|
|
= link_to "Change your location.", edit_member_registration_path
|
|
.card-footer
|
|
.text-right= f.submit 'Save'
|