Files
growstuff/app/views/crops/_wrangle.html.haml
google-labs-jules[bot] 449ab1f6c0 Add ability to create companion plantings
This change adds the ability for crop wranglers to create and manage companion plantings for crops.

- Adds a `source_url` to the `CropCompanion` model to store an optional reference URL.
- Restricts the management of companion plantings to users with the `crop_wrangler` role.
- Creates a new admin interface for managing companion plantings for a specific crop.
- Updates the crop show page to display companions from both the crop and its parent crop.
2025-09-21 00:49:11 +00:00

25 lines
961 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_gbif_path(crop), method: :post, class: 'dropdown-item' do
= icon 'far', 'update'
Fetch data from GBIF
= link_to admin_crop_crop_companions_path(crop), class: 'dropdown-item' do
= icon 'fas', 'leaf'
Manage Companions
- if can? :destroy, crop
.dropdown-divider
= delete_button(crop, classes: 'dropdown-item text-danger')