hummingbird-me/hummingbird

View on GitHub
app/views/anime/_mini_gallery.html.haml

Summary

Maintainability
Test Coverage
.screenshots.large-12.columns
  - if @gallery.length >= 1
    .large-12.columns.mobile-two.columns= image_tag @gallery[0].image.url(:thumb)
    - if @gallery.length >= 3
      .left-small.large-6.columns.mobile-two.columns= image_tag @gallery[1].image.url(:thumb)
      .right-small.large-6.columns.mobile-two.columns= image_tag @gallery[2].image.url(:thumb)
      - if @gallery.length >= 4
        .large-12.columns= image_tag @gallery[3].image.url(:thumb)
        - if @gallery.length >= 6
          .left-small.large-6.columns.mobile-two.columns= image_tag @gallery[4].image.url(:thumb)
          .right-small.large-6.columns.mobile-two.columns= image_tag @gallery[5].image.url(:thumb)
  - else

    .no-images.large-12.columns
      = image_tag "http://cl.ly/image/1O0Q3j0y1K3w/no-images@2x.png"
      %p No screenshots found for this anime :(
  // %p= link_to "view full gallery", "#"