Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Products tile design update (#3490)
Browse files Browse the repository at this point in the history
* Update Amazon CSS to new design

* Remove old JS

* Update brand class

* Move ratings into price container

* Use new showBrand variable

* Update css for --has-brand class

* More tweaks to footer styles

* Increase webkit lineclamp to 3 when no brand

* Remove absolute position, not needed

* Add CSS for mobile screens

* Remove custom CSS, moved to internal CSS

* Remove opt--t-xxs class

* Fix vertical alignment of footer elements

* Add back right float
  • Loading branch information
moollaza authored and bsstoner committed Feb 13, 2018
1 parent e34c0c5 commit 1af8951
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 57 deletions.
38 changes: 0 additions & 38 deletions share/spice/amazon/amazon.css

This file was deleted.

8 changes: 1 addition & 7 deletions share/spice/amazon/amazon.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
if (api_result.results.length > 1) {
// var itemTemplate = 'products_item';
var itemTemplate = Spice.amazon.branded_products_item;
switch (DDG.page.ads && DDG.page.ads.adxExperiment) {
case 'prod_brand_v1':
itemTemplate = Spice.amazon.branded_products_item;
break;
default:
break;
}
templates = {
item: itemTemplate,
options: {
Expand Down Expand Up @@ -60,6 +53,7 @@
},
normalize: function(item) {
item.showBadge = item.is_prime;
item.showBrand = item.brand && item.brand_query;

return item;
},
Expand Down
23 changes: 11 additions & 12 deletions share/spice/amazon/branded_products_item.handlebars
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
<div class="tile tile--pr tile--c has-detail tile--{{parentId}} opt--t-xxs" data-link="{{url}}">
<div class="tile tile--pr tile--c has-detail tile--{{parentId}} {{#if showBrand}}tile--has-brand{{/if}}" data-link="{{url}}">
<div class="tile__media tile__media--pr">
<img src="" data-src="{{{imageProxy img}}}" alt="{{title}}" class="tile__media__img js-lazyload" />
{{#and showBadge meta.options.badge}}{{{include meta.options.badge}}}{{/and}}
</div>
<div class="tile__body tile__body--pr">
{{#and brand brand_query}}
{{{formatTitle brand el="h5" className="tile__title--brand" classNameSec="tile__title--pr" href="brand_query" optSub=true ellipsis=100}}}
{{/and}}
{{#if showBrand}}
{{{formatTitle brand el="h5" className="tile__title tile__title--brand" classNameSec="tile__title--pr" href="brand_query" optSub=true ellipsis=100}}}
{{/if}}
{{#if url}}
{{{formatTitle heading el="h6" className="tile__title" classNameSec="tile__title--pr" href="url" optSub=true ellipsis=100}}}
{{else}}
{{{formatTitle heading el="h6" className="tile__title" classNameSec="tile__title--pr" optSub=true ellipsis=100}}}
{{{formatTitle heading el="h6" className="tile__title" classNameSec="tile__title--pr" optSub=true ellipsis=100}}}
{{/if}}
<div class="tile__tx tile--pr__sub one-line">
<div class="tile--pr__sub one-line">
{{#and meta.options.price price}}
<span class="tile--pr__price price">{{price}}</span>
<span class="tile--pr__price price pull-left">{{price}}</span>
{{/and}}
</div>
{{#if meta.options.rating}}
<div class="tile__tx tile__rating one-line">
{{{starsAndReviews rating reviewCount url_review true}}}
</div>
<span class="tile--pr__rating tile__rating pull-right">
{{{starsAndReviews rating reviewCount url_review true}}}
</span>
{{/if}}
</div>
</div>
</div>

0 comments on commit 1af8951

Please sign in to comment.