Growstuff/growstuff

View on GitHub
app/views/plantings/_photos.haml

Summary

Maintainability
Test Coverage
%h2 Photos
- if planting.photos.size.positive?
  = render 'photos/gallery', photos: photos
  - if can?(:edit, planting) && can?(:create, Photo)
    %p.text-right= add_photo_button(planting)
  %p.text-right
    = link_to planting_photos_path(planting), class: 'btn' do
      = photo_icon
      more photos
- else
  %p No photos.
  - if can?(:edit, planting) && can?(:create, Photo)
    %p Add a photo to visually track growth of this planting, to Flickr, iNaturalist or Pl@ntNet
    = add_photo_button(planting)