kaize/deadline_camp

View on GitHub
app/views/web/photo_albums/index.html.haml

Summary

Maintainability
Test Coverage
- @photo_albums.each_with_index do |album, i|
  - unless i == 0
    .center.splitter
      = image_tag 'grey_out.png'
  .row
    .span4
      %h4= album.name
      %p= album.description
    .span8
      .carousel.slide{ :id => "carousel_#{album.id}" }
        .carousel-inner
          - album.sorted_photos.each_with_index do |photo, i|
            .item{:class => i == 0 ? "active" : ''}
              = image_tag photo.image_url(:carousel)
              - if photo.name? || photo.description?
                .carousel-caption
                  %h4= photo.name
                  %p= photo.description
        %a.carousel-control.left{"data-slide" => "prev", :href => "#carousel_#{album.id}"} ‹
        %a.carousel-control.right{"data-slide" => "next", :href => "#carousel_#{album.id}"} ›