publiclab/spectral-workbench

View on GitHub
app/views/spectrums/_list.html.erb

Summary

Maintainability
Test Coverage
<style>._row { clear:left;} </style>

<div class="_row">
  <% spectrums.each_with_index do |spectrum,i| %>
    <div class="span3 clearfix">
      <% if spectrum.photo_file_name %>
        <a class="image hidden-phone" href="<%= spectrum_path(spectrum.id) %>">
          <img src="<%= spectrum.photo.url(:thumb) %>" class="image" style="background:#ccc;">
        </a>
      <% end %>
      <a class="image visible-phone" style="float:left;width:50%;margin-right:10px;" href="<%= spectrum_path(spectrum.id) %>"><img src="<%= spectrum.photo.url(:thumb) %>" class="image" style="background:#ccc;"></a>
      <h4><a data-transition="slide" href="<%= spectrum_path(spectrum.id) %>"><%=h truncate(spectrum.title,:length => 18) %></a></h4>
      <p><a data-transition="slide" href="<%=h user_path(spectrum.author) %>"><%=h spectrum.author %></a> | <%= time_ago_in_words(spectrum.created_at) %> ago<% if spectrum.like_count.positive? %> <i class="fa fa-star"></i> <%= spectrum.like_count %><% end %></p>
    </div>
    <% if ((i+1)/4.0).to_i == ((i+1)/4.0) %>
    </div>
    <hr class="hidden-phone" style="clear:both;"/>
    <div class="_row">
    <% end %>
  <% end %>
</div>