index.rhtml
4.66 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<% extra_content = [] %>
<% extra_content_list = [] %>
<ul id="product-list">
<li><h1><%= _('Products/Services') %></h1></li>
<% @products.each do |product| %>
<% extra_content = @plugins.map(:catalog_item_extras, product).collect { |content| instance_eval(&content) } %>
<% extra_content_list = @plugins.map(:catalog_list_item_extras, product).collect { |content| instance_eval(&content) } %>
<li class="product <%= "not-available" unless product.available %>">
<ul>
<li class="product-image-link">
<% if product.image %>
<div class="zoomable-image">
<%= link_to_product product, :class => 'product-big', :style => "background-image: url(#{product.default_image(:big)})" %>
<a href='<%= product.default_image(:big).gsub('_big','') %>' class="zoomify-image"><span><%= _('Zoom in') %></span></a>
</div>
<% else %>
<div class="no-image"><%= _('No image') %></div>
<% end %>
<div class="catalog-item-extras"><%= extra_content.join("\n") %></div>
</li>
<li class="product-link"><%= link_to_product product %></li>
<li class="product-price-line">
<% unless product.discount.blank? or product.discount == 0 %>
<span class="product-discount">
<span><%= _('from ') + price_span(product.price) %></span>
<span class="product-discount-by"><%= _('by ') %></span>
</span>
<% end %>
<% unless product.price.blank? or product.price == 0 %>
<span class="product-price">
<%= price_span product.price_with_discount, :class => "product-price #{'with-discount' unless product.discount}" %>
<span class="product-unit"><%= _(' / ') + (product.unit ? product.unit.singular : _('unit')) %></span>
</span>
<% end %>
<div style="clear: both"></div>
</li>
<% if product.description %>
<li class="product-description expand-box">
<span id="product-description-button"><%= _('description') %></span>
<div>
<div class="arrow"></div>
<div class="content" id="product-description"><%= txt2html(product.description || '') %></div>
</div>
</li>
<% end %>
<% if product.is_open_price? %>
<li class="product-price-composition expand-box">
<span id="product-price-composition-button"><%= _('price composition') %></span>
<div>
<div class="arrow"></div>
<div class="content" id="product-price-composition">
<% product.inputs.each do |i| %>
<div class="search-product-input-dots-to-price">
<div class="search-product-input-name"><%= i.product_category.name %></div>
<%= price_span i.price_per_unit * i.amount_used, :class => 'search-product-input-price' %>
</div>
<% end %>
</div>
</div>
</li>
<% end %>
<% if product.inputs.count > 0 %>
<li class="product-inputs expand-box">
<span id="inputs-button"><%= _('inputs and raw materials') %></span>
<div>
<div class="arrow"></div>
<div class="content" id="inputs-description">
<% product.inputs.each do |i| %>
<div><%= "#{i.amount_used} #{i.unit.singular} #{_('of')} " if i.has_all_price_details? %>
<%= "#{i.product_category.name}" %></div>
<% end %>
</div>
</div>
</li>
<% end %>
<% unless product.qualifiers.blank? %>
<li class="product-qualifiers">
<span><%= _('qualifiers') if product.product_qualifiers.count > 0 %></span>
<div><%= render :partial => 'shared/product/qualifiers', :locals => {:product => product} %></div>
<% end %>
<% extra_content_list.map do |content| %>
<li class="catalog-list-item-extras"><%= content %></li>
<% end %>
<li class="product-unavailable"><%= _('product unavailable') unless product.available %></li>
</ul>
</li>
<% end %>
</ul>
<%= pagination_links @products, :params => {:controller => :catalog, :action => :index, :profile => profile.identifier} %>
<link href="/stylesheets/fancybox.css?1323903734" media="screen" rel="stylesheet" type="text/css" /><script src="/javascripts/jquery.fancybox-1.3.4.pack.js?1323903734" type="text/javascript"></script><script type="text/javascript">
//<![CDATA[
jQuery(function($) {
$(window).load( function() {
$('.zoomify-image').fancybox();
});
});
//]]>
</script>