mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-04-12 02:50:27 -04:00
This commit introduces a new `Problem` model, analogous to `Crop`, to allow users to track problems they have on their plantings (e.g., aphids on tomatoes). Key features: - A new `Problem` model that can be curated by admins (`problem_wranglers`). - Users can associate problems with their plantings and upload photos of the problems. - Aggregated problem information is displayed on the crop detail page (e.g., "Problems: aphids (27), blight (13)"). - Users can mention problems in posts (e.g., `[aphids](problem)`), which automatically links to the problem's page. - Admin functionality for reviewing and approving new problem suggestions. Resolves merge conflict in app/controllers/plantings_controller.rb
55 lines
1.7 KiB
Plaintext
55 lines
1.7 KiB
Plaintext
.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2
|
|
.card-header
|
|
- if content_for? :title
|
|
%h1.h2-responsive.text-center
|
|
= planting_icon
|
|
%strong=yield :title
|
|
= bootstrap_form_for(@activity) do |f|
|
|
.card-body
|
|
- if @activity.errors.any?
|
|
#error_explanation
|
|
%h2
|
|
= pluralize(@activity.errors.size, "error")
|
|
prohibited this activity from being saved:
|
|
%ul
|
|
- @activity.errors.full_messages.each do |msg|
|
|
%li= msg
|
|
|
|
.row
|
|
.col-md-12
|
|
= f.text_field :name, required: true, label: 'What needs to be done?'
|
|
.row
|
|
.col-md-4
|
|
= f.select(:category, Activity::CATEGORIES, include_blank: true)
|
|
.row
|
|
.col-md-12
|
|
= f.text_area :description, rows: 6, label: 'Tell us more about it'
|
|
|
|
.row
|
|
.col-md-4
|
|
= f.collection_radio_buttons(:garden_id, @activity.owner.gardens.active,
|
|
:id, :name,
|
|
label: 'Is this for a specific garden?')
|
|
= link_to "Add a garden.", new_garden_path
|
|
|
|
.col-md-4
|
|
= f.collection_radio_buttons(:planting_id, @activity.owner.plantings.active,
|
|
:id, :crop_name,
|
|
label: 'Is this for a specific planting?')
|
|
= link_to "Add a planting.", new_planting_path
|
|
|
|
.col-md-4
|
|
= f.date_field :due_date,
|
|
value: @activity.due_date ? @activity.due_date.to_fs(:ymd) : '',
|
|
label: 'When?'
|
|
|
|
%hr
|
|
|
|
.row
|
|
.col-md-6
|
|
= f.check_box :finished, label: 'Mark as finished'
|
|
%span.help-block= t('.finish_helper')
|
|
|
|
.card-footer
|
|
.text-right= f.submit 'Save'
|