mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-04-13 11:30:54 -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
25 lines
972 B
Plaintext
25 lines
972 B
Plaintext
- if can?(:edit, crop) || can?(:destroy, crop)
|
|
.alert.alert-success{role: "alert"}
|
|
%p
|
|
You are a
|
|
%strong CROP WRANGLER
|
|
.dropdown.crop-actions
|
|
%a#crop-actions-button.btn.btn-info.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", :type => "button", href: '#'} Actions
|
|
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "crop-actions-button"}
|
|
= link_to edit_crop_path(crop), class: 'dropdown-item' do
|
|
= edit_icon
|
|
= t('.edit')
|
|
|
|
= link_to crop_openfarm_path(crop), method: :post, class: 'dropdown-item' do
|
|
= icon 'far', 'update'
|
|
Fetch data from OpenFarm
|
|
|
|
= link_to crop_gbif_path(crop), method: :post, class: 'dropdown-item' do
|
|
= icon 'far', 'update'
|
|
Fetch data from GBIF
|
|
|
|
- if can? :destroy, crop
|
|
.dropdown-divider
|
|
= delete_button(crop, classes: 'dropdown-item text-danger')
|
|
|