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