Files
growstuff/app/views/crops/_alternate_names.html.haml
google-labs-jules[bot] ac1463e2cf Add international alternate names for crops (#4132)
* I will add the international alternate names for the crops.

* Mark required

* Update factory

* Add placeholder

* Fix seeds

* Add language, though hardcoded to EN in most places

---------

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>
2025-08-24 21:44:41 +09:30

25 lines
1.0 KiB
Plaintext

.alternate_names
%h4 Alternate names
- if crop.alternate_names.any?
- crop.alternate_names.each do |an|
- if can? :edit, an
.dropdown.planting-actions
%a#crop-actions-altnames.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", :type => "button", :href => '#'}
= "#{an.name} (#{an.language})"
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "crop-actions-altnames"}
- if can? :edit, an
= link_to edit_alternate_name_path(an), class: 'dropdown-item' do
= edit_icon
= t('.edit')
- if can? :destroy, an
= link_to an, method: :delete, data: { confirm: 'Are you sure?' }, class: 'dropdown-item' do
= delete_icon
= t('.delete')
- else
.badge= "#{an.name} (#{an.language})"
%p.text-right
- if can? :edit, crop
= link_to 'Add', new_alternate_name_path(crop_id: crop.id), class: 'btn btn-default btn-xs'