spree-contrib/spree_reviews

View on GitHub
app/views/spree/shared/_rating.html.erb

Summary

Maintainability
Test Coverage
<% stars = product.stars %>
<% reviews_count = product.reviews_count %>
<div class="ratings">
  <p><%= Spree.t(:average_customer_rating) %>:</p>
  <p class="ratings-stars">
    <span title="<%= txt_stars(stars) %>">
      <%= render 'spree/reviews/stars', stars: stars %>
    </span>
  </p>
  <p class="ratings-basedupon">(<%= Spree.t(:based_upon_review_count, count: reviews_count) %>)</p>
  <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
    <span itemprop="ratingValue" content="<%= stars %>"></span>
    <span itemprop="reviewCount" content="<%= reviews_count %>"></span>
  </div>
</div>