Files
growstuff/app/views/crops/_hierarchy.html.haml
Brenda Wallace b0c8b11246 📝 Inline editing and display tidy ups (#2200)
* Inline editing and display tidy ups
2019-10-08 11:06:53 +13:00

14 lines
502 B
Plaintext

%ul
- @count ||= 0
- unless defined? max
- max = 0 # list all without "show all" toggle button
- display_crops.each do |c|
%li.crop-hierarchy{ class: (max != 0 && @count >= max) || !c.approved? ? ['hide', 'toggle'] : [] }
= render 'crops/tiny', crop: c
- if c.perennial
= perennial_icon
- @count += 1
- if c.varieties.present?
- c.varieties.order(:name).each do |v|
= render partial: 'hierarchy', locals: { display_crops: [v], max: max }