Skip to content

Instantly share code, notes, and snippets.

@brapse
Created January 8, 2010 16:15
Show Gist options
  • Save brapse/272149 to your computer and use it in GitHub Desktop.
Save brapse/272149 to your computer and use it in GitHub Desktop.
htmlizers.merchant = function(product) {
var reviews = product.merchant.review.count;
var ratingValue = product.merchant.review.average;
return $R().td({class: "search_results_bank_summary"}).
table().
tr().
td({width: 25px}).
img({width: 22, height: 22, src: product.merchant.logo}).end();
end().
ul().
li().
a({class: "product_link", href: product.link}, lenderName(product)).end().
end().
li({class: "review"}).
img({src: "/images/" + ratingValue.toString().replace(/\./, '-') + 'star.gif'}).end().
end().
li({class: "review"}).
text("reviews" + pluralize(reviews, ' review')).render();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment