From beab7fcfda2ae97d6ed9803624789b239c1eab72 Mon Sep 17 00:00:00 2001 From: Brandon Baker Date: Sun, 25 Nov 2018 17:48:02 -0700 Subject: [PATCH] hides crop varieties that have not been approved --- CONTRIBUTORS.md | 1 + app/views/crops/_hierarchy.html.haml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4447030c4..a9f784ac3 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -86,6 +86,7 @@ submit the change with your pull request. - Jennifer Kruse / [jenkr55](https://github.com/jenkr55) - Christopher Bazin / [RobotScissors](https://github.com/robotscissors) - Ahmed Shahin / [codeminator](https://www.github.com/codeminator) +- Brandon Baker / [brandonbaker40](https://github.com/brandonbaker40) ## Bots diff --git a/app/views/crops/_hierarchy.html.haml b/app/views/crops/_hierarchy.html.haml index 19be51f6d..a4b760354 100644 --- a/app/views/crops/_hierarchy.html.haml +++ b/app/views/crops/_hierarchy.html.haml @@ -3,7 +3,7 @@ - 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 ? ['hide', 'toggle'] : [] } + %li.crop-hierarchy{ class: (max != 0 && @count >= max) || !c.approved? ? ['hide', 'toggle'] : [] } = link_to c, c - @count += 1 - if c.varieties.present?