-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path_edgy_related_table.html.erb
More file actions
37 lines (37 loc) · 1.29 KB
/
_edgy_related_table.html.erb
File metadata and controls
37 lines (37 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<% unless edgy_related(options).empty? -%>
<table class="edgy-related">
<tr>
<td colspan="<%= orientation == :horizontal ? edgy_related.size : 2 %>">
<h3 class="edgy-label"><%= options[:message] || edgy_message %></h3>
</td>
</tr>
<% if orientation == :horizontal %>
<tr>
<% edgy_related.each do |related_product| %>
<td class="edgy-image" style="width: <%= (100 / edgy_related.size) %>%">
<%= link_to small_image(related_product), related_product %></td>
<% end %>
</tr>
<tr>
<% edgy_related.each do |related_product| %>
<td class="edgy-label">
<%=h link_to related_product.name, related_product %><br />
<span class="price"><%=h product_price(related_product) %></span>
</td>
<% end %>
</tr>
<% else %>
<% edgy_related.each do |related_product| -%>
<tr>
<td class="edgy-image">
<%= link_to small_image(related_product), related_product %>
</td>
<td class="edgy-label">
<%=h link_to related_product.name, related_product %><br />
<span class="price"><%=h product_price(related_product) %></span>
</td>
</tr>
<% end %>
<% end %>
</table>
<% end %>