mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-30 18:58:39 -04:00
The text read from a packet is kept in seeds.packet_text but is not on any form or page yet: the OCR script will fill it in a follow-up. The column's migration comment had an apostrophe that broke its string, so it did not run.
44 lines
1.9 KiB
Plaintext
44 lines
1.9 KiB
Plaintext
-# Editing a packet of seed in a dialog over the page, rather than sending the
|
|
-# member off to a form of its own. The form posts as it always has, so this
|
|
-# needs no JSON endpoint. Large text comes from .plant-dialog-body, as in the
|
|
-# React dialogs. The crop isn't offered: changing what a packet is would make
|
|
-# it a different packet.
|
|
= form_modal(seed, id: 'seed-edit-modal', title: "Edit #{seed.crop.name} seeds") do |f|
|
|
.row.mb-3
|
|
.col-md-6
|
|
= f.date_field :saved_at,
|
|
value: seed.saved_at ? seed.saved_at.to_fs(:ymd) : '',
|
|
label: 'When were they saved?'
|
|
.col-md-6
|
|
= f.number_field :quantity, min: 0, label: 'How many seeds?'
|
|
.row.mb-3
|
|
.col-md-6
|
|
= f.number_field :plant_before_year, label: 'Plant before (year)',
|
|
min: Seed::PLANT_BEFORE_YEARS.first, max: Seed::PLANT_BEFORE_YEARS.last
|
|
.col-md-6
|
|
= f.select :tradable_to, Seed::TRADABLE_TO_VALUES, { include_blank: false, label: 'Will trade' }
|
|
.row.mb-3
|
|
.col-md-6
|
|
= f.text_field :variety, label: 'Variety'
|
|
.col-md-6
|
|
= f.text_field :batch_number, label: 'Batch number'
|
|
.row.mb-3
|
|
.col-md-6
|
|
= f.number_field :days_until_maturity_min, min: 1, label: 'Days until maturity (min)'
|
|
.col-md-6
|
|
= f.number_field :days_until_maturity_max, min: 1, label: 'Days until maturity (max)'
|
|
.row.mb-3
|
|
.col-md-6
|
|
= f.number_field :row_spacing, min: 1, label: 'Row spacing (cm)'
|
|
.row.mb-3
|
|
.col-md-4
|
|
= f.select :organic, Seed::ORGANIC_VALUES, { include_blank: false, label: 'Organic?' }
|
|
.col-md-4
|
|
= f.select :gmo, Seed::GMO_VALUES, { include_blank: false, label: 'GMO?' }
|
|
.col-md-4
|
|
= f.select :heirloom, Seed::HEIRLOOM_VALUES, { include_blank: false, label: 'Heirloom?' }
|
|
.mb-3
|
|
= f.select :source, Seed::SOURCE_VALUES, { include_blank: false, label: 'Where did they come from?' }
|
|
.mb-3
|
|
= f.text_area :description, rows: 4, label: 'Notes'
|