johnrees/fablabs

View on GitHub
app/views/search/_lab.html.haml

Summary

Maintainability
Test Coverage
- cache ["v1-#{I18n.locale}", lab] do
  = content_tag_for :div, lab, class: 'media', itemscope: true, itemtype: "http://data-vocabulary.org/Organization" do
    .img.float-left
      = link_to lab do
        = image_tag lab.avatar.thumb("100x100").url, class: 'med avatar', itemprop: "logo"
    .media-body
      = link_to lab, class: 'name' do
        %span.name{itemprop: "name"}= lab
      %span.url.microdata{itemprop: "url"}= lab_url(lab, {locale: nil})
      .lab-location
        - if lab.short_address(!params[:country]).present?
          = icon "map-marker"
          %span.short_address{itemprop: "addressLocality"}= lab.short_address(!params[:country])
          %span.microdata.country{itemprop: "country"}= lab.country_code
        - if lab.email.present?
          = icon "envelope-o"
          %span.email= mail_to(lab.email, lab.email)
        - if lab.phone.present?
          = icon "phone"
          %span.telephone{itemprop: "telephone"}= lab.phone
      %p.lab-blurb.truncate{itemprop: "description"}= lab.blurb