Commit 89a952dcc6b7ac15b708241073dddfe6d7e87654

Authored by Rafael Martins
1 parent 368a90c0

Catalog fix for correctly showing "add to cart"

app/views/catalog/index.rhtml
@@ -10,16 +10,17 @@ @@ -10,16 +10,17 @@
10 10
11 <li class="product <%= "not-available" unless product.available %>"> 11 <li class="product <%= "not-available" unless product.available %>">
12 <ul> 12 <ul>
13 - <% if product.image %>  
14 - <li id="product-image-link"> 13 + <li class="product-image-link">
  14 + <% if product.image %>
15 <div class="zoomable-image"> 15 <div class="zoomable-image">
16 - <%= image_link_to_product product, :class => 'product-big' %>  
17 - <a href='<%= product.default_image(:big).gsub('_big','') %>' class="zoomify-image"><span><%= _('Zoom in') %></span></a> 16 + <%= link_to_product product, :class => 'product-big', :style => "background-image: url(#{product.default_image(:big)})" %>
  17 + <a href='<%= product.default_image(:big).gsub('_big','') %>' class="zoomify-image"><span><%= _('Zoom in') %></span></a>
18 </div> 18 </div>
19 - </li>  
20 - <% else %>  
21 - <li class="product-big no-image"><%= _('No image') %></li>  
22 - <% end %> 19 + <% else %>
  20 + <div class="no-image"><%= _('No image') %></div>
  21 + <% end %>
  22 + <div class="catalog-item-extras"><%= extra_content.join("\n") %></div>
  23 + </li>
23 24
24 <li class="product-link"><%= link_to_product product %></li> 25 <li class="product-link"><%= link_to_product product %></li>
25 26
@@ -88,11 +89,9 @@ @@ -88,11 +89,9 @@
88 <% end %> 89 <% end %>
89 90
90 <% extra_content_list.map do |content| %> 91 <% extra_content_list.map do |content| %>
91 - <li><%= content %></li> 92 + <li class="catalog-list-item-extras"><%= content %></li>
92 <% end %> 93 <% end %>
93 94
94 - <li><%= extra_content.join("\n") %></li>  
95 -  
96 <li class="product-unavailable"><%= _('product unavailable') unless product.available %></li> 95 <li class="product-unavailable"><%= _('product unavailable') unless product.available %></li>
97 </ul> 96 </ul>
98 </li> 97 </li>
features/browse_catalogs.feature
@@ -26,7 +26,7 @@ Feature: browse catalogs @@ -26,7 +26,7 @@ Feature: browse catalogs
26 | artebonito | categ1 | 26 | artebonito | categ1 |
27 And I am on /catalog/artebonito 27 And I am on /catalog/artebonito
28 Then I should see "categ1" within "li.product-link" 28 Then I should see "categ1" within "li.product-link"
29 - And I should see "No image" within "li.product-big" 29 + And I should see "No image" within ".no-image"
30 And I should not see "unit" within "#product-list" 30 And I should not see "unit" within "#product-list"
31 And I should not see "product unavailable" 31 And I should not see "product unavailable"
32 And I should not see "description" 32 And I should not see "description"
@@ -39,7 +39,7 @@ Feature: browse catalogs @@ -39,7 +39,7 @@ Feature: browse catalogs
39 | artebonito | categ1 | Produto1 | 39 | artebonito | categ1 | Produto1 |
40 And I am on /catalog/artebonito 40 And I am on /catalog/artebonito
41 Then I should see "Produto1" within "li.product-link" 41 Then I should see "Produto1" within "li.product-link"
42 - And I should see "No image" within "li.product-big" 42 + And I should see "No image" within ".no-image"
43 And I should not see "unit" within "#product-list" 43 And I should not see "unit" within "#product-list"
44 And I should not see "product unavailable" 44 And I should not see "product unavailable"
45 And I should not see "description" 45 And I should not see "description"
@@ -54,7 +54,7 @@ Feature: browse catalogs @@ -54,7 +54,7 @@ Feature: browse catalogs
54 Then I should see "Produto1" within "li.product-link" 54 Then I should see "Produto1" within "li.product-link"
55 And I should see "50.00" within "span.product-price" 55 And I should see "50.00" within "span.product-price"
56 And I should see "unit" within "span.product-unit" 56 And I should see "unit" within "span.product-unit"
57 - And I should see "No image" within "li.product-big" 57 + And I should see "No image" within ".no-image"
58 And I should not see "product unavailable" 58 And I should not see "product unavailable"
59 And I should not see "description" 59 And I should not see "description"
60 And I should not see "qualifiers" 60 And I should not see "qualifiers"
@@ -67,7 +67,7 @@ Feature: browse catalogs @@ -67,7 +67,7 @@ Feature: browse catalogs
67 And I am on /catalog/artebonito 67 And I am on /catalog/artebonito
68 Then I should see "Produto1" within "li.product-link" 68 Then I should see "Produto1" within "li.product-link"
69 And I should not see "0.00" 69 And I should not see "0.00"
70 - And I should see "No image" within "li.product-big" 70 + And I should see "No image" within ".no-image"
71 And I should not see "product unavailable" 71 And I should not see "product unavailable"
72 And I should not see "description" 72 And I should not see "description"
73 And I should not see "qualifiers" 73 And I should not see "qualifiers"
@@ -108,7 +108,7 @@ Feature: browse catalogs @@ -108,7 +108,7 @@ Feature: browse catalogs
108 | owner | category | name | price | img | 108 | owner | category | name | price | img |
109 | artebonito | categ1 | Agrotox | 12.34 | agrotox | 109 | artebonito | categ1 | Agrotox | 12.34 | agrotox |
110 And I am on /catalog/artebonito 110 And I am on /catalog/artebonito
111 - When I follow "Agrotox" within "#product-image-link" 111 + When I follow "Agrotox" within ".product-image-link"
112 Then I should be taken to "Agrotox" product page 112 Then I should be taken to "Agrotox" product page
113 113
114 Scenario: display product with discount 114 Scenario: display product with discount
public/stylesheets/application.css
@@ -3131,19 +3131,40 @@ div#activation_enterprise div { @@ -3131,19 +3131,40 @@ div#activation_enterprise div {
3131 #product-list .search-product-input-price { 3131 #product-list .search-product-input-price {
3132 background-color: #DCFFD7; 3132 background-color: #DCFFD7;
3133 } 3133 }
  3134 +
  3135 +#product-list .catalog-item-extras {
  3136 + position: absolute;
  3137 + bottom: 0px;
  3138 + right: 0px;
  3139 +}
3134 #product-list .product-big { 3140 #product-list .product-big {
  3141 + background-repeat: no-repeat;
  3142 + background-position: 50% 50%;
3135 display: block; 3143 display: block;
3136 width: 200px; 3144 width: 200px;
3137 height: 160px; 3145 height: 160px;
  3146 +}
  3147 +#product-list .ui-button {
  3148 + margin: 0;
  3149 +}
  3150 +#product-list .ui-button-text {
  3151 + color: #D38D5F;
  3152 + font-size: 0.8em;
  3153 + padding: 0.1em 0.3em 0.1em 3em;
  3154 + }
  3155 +#product-list .product-big span {
  3156 + display: none;
  3157 +}
  3158 +#product-list .product-image-link {
  3159 + position: relative;
  3160 + width: 200px;
  3161 + height: 160px;
3138 border: 1px solid #BFBFBF; 3162 border: 1px solid #BFBFBF;
3139 -/* background-repeat: no-repeat;  
3140 - background-position: 50% 50%; */  
3141 position: relative; /* work arround msie bug */ 3163 position: relative; /* work arround msie bug */
3142 text-align: center; 3164 text-align: center;
3143 - display: table-cell;  
3144 vertical-align: middle; 3165 vertical-align: middle;
3145 } 3166 }
3146 -#product-list .product-big.no-image { 3167 +#product-list .product-image-link .no-image {
3147 line-height: 145px; 3168 line-height: 145px;
3148 text-align: center; 3169 text-align: center;
3149 color: #777; 3170 color: #777;
@@ -3156,9 +3177,6 @@ div#activation_enterprise div { @@ -3156,9 +3177,6 @@ div#activation_enterprise div {
3156 -khtml-user-select: none; 3177 -khtml-user-select: none;
3157 -webkit-user-select: none; 3178 -webkit-user-select: none;
3158 } 3179 }
3159 -#product-list .product-big span {  
3160 - display: none;  
3161 -}  
3162 #product-list li.product-unavailable { 3180 #product-list li.product-unavailable {
3163 text-transform: uppercase; 3181 text-transform: uppercase;
3164 color: #FF6261; 3182 color: #FF6261;