Files
growstuff/app/views/crops/_info.haml
2025-11-30 03:09:55 +00:00

32 lines
1.2 KiB
Plaintext

.row.crop-info
.col-md-9
%h1
= crop_icon(@crop)
%strong.crop-name= @crop.name.titleize
- unless @crop.approved?
%badge.badge-warning=@crop.approval_status
%small.text-muted= @crop.default_scientific_name
- if crop_or_parent(@crop, :sowing_method).present?
%p
%strong How to sow #{@crop.name}:
= crop_or_parent(@crop, :sowing_method)
- if crop_or_parent(@crop, :sun_requirements).present?
%p
%strong Sun requirement for #{@crop}:
Plant in #{crop_or_parent(@crop, :sun_requirements)}
%p.text-muted
- if !@crop.plantings.empty?
#{@crop.name.titleize} has been planted
= pluralize(@crop.plantings.size, "time")
by #{ENV['GROWSTUFF_SITE_NAME']} members.
- else
Nobody is growing this yet. You could be the first!
- if crop_or_parent(@crop, :description).present?
%p= simple_format crop_or_parent(@crop, :description)
- else
- if member_signed_in?
%p= link_to "Add a description.", edit_crop_path(@crop, anchor: ":~:text=Description")
.col-md-3
= image_tag crop_image_path(@crop),
class: 'img-responsive shadow rounded crop-hero-photo', alt: "Image of #{@crop.name}"