nukomeet/coworfing

View on GitHub
app/views/places/_place.html.haml

Summary

Maintainability
Test Coverage
%li.span3
  .thumbnail
    - if place.photos.empty?
      = link_to image_tag('home.jpg', :'data-original' => asset_path('home.jpg'), class: "lazy"), place, rel: "popover", "data-original-title" => place.name, "data-content" => place.desc, class: 'place_photo'
    - else
      = link_to image_tag('home.jpg', :'data-original'=> place.photos.first.photo_url(:medium), class: "lazy"), place, rel: "popover", "data-original-title" => place.name, "data-content" => place.desc, class: 'place_photo'
    .caption
      %h5
        = link_to truncate(place.name, length: 17), place
        %span{ :class=> "label label-#{place.kind} pull-right upcase" } 
          = link_to place.kind, places_url(by_kind: place.kind)
      .place_row
        = truncate(place.desc, length: 17)