module-and-template-store/app/views/shared/_item_card.html.erb

22 lines
1.0 KiB
Plaintext
Raw Normal View History

2014-03-14 06:37:59 +00:00
<% @products = (@templates if type.eql?('templates')) || (@extensions if type.eql?('extensions')) %>
2014-03-14 07:31:37 +00:00
<% cache [ 'product list', expires_in: 60.seconds ] do %>
<% @products.each do |product| %>
2014-03-14 06:37:59 +00:00
<div class="card-content <%= type == 'templates' ? type : 'apps' %>">
<div class="card-inner">
<div class="cover">
<%= link_to "", product, :class=> "details-link" %>
<div class="cover-image">
<%= placeholdit_image_tag (type == 'templates' ? "256x180" : '100x100'), background_color: "#3f3f3f" %>
</div>
</div>
<div class="details">
<%= content_tag(:h2, (link_to product.title, product), :class => "item-title") %>
2014-03-14 07:31:37 +00:00
<%= content_tag(:p, (link_to "Developer: #{product.author}"), :class => "developer-title") %>
2014-03-14 06:37:59 +00:00
<%= render :partial => "shared/stars_rank" if type != 'templates' %>
<%= content_tag(:p, product.price.nil?.eql?(true) ? 'Free' : product.price, :class => "price-container") %>
</div>
</div>
</div>
2014-03-14 07:31:37 +00:00
<% end %>
2014-03-14 06:37:59 +00:00
<% end %>