hhff/spree-ember

View on GitHub
packages/storefront/addon/templates/components/spree-lineitems.hbs

Summary

Maintainability
Test Coverage
<table>
  <thead>
    <tr>
      <th class="text-center" colspan="2">Item</th>
      <th class="text-center" width="100">Price</th>
      <th class="text-center" width="100">Quantity</th>
      <th class="text-center" width="100">Total</th>
      {{#if canRemoveItems}}
        <th class="text-center" width="100"></th>
      {{/if}}  
    </tr>
  </thead>
  <tbody>
    {{#each lineItem in lineItems}}
      <tr>
        <td width="120"><img {{bind-attr src=lineItem.variant.images.firstObject.smallUrl}}></td>
        <td>
          <h5>{{lineItem.variant.name}}</h5>
          <p>{{lineItem.variant.optionsText}}</p>
          {{lineItem.variant.description}}
        </td>
        <td class="text-center">{{lineItem.singleDisplayAmount}}</td>
        <td class="text-center">{{lineItem.quantity}}</td>
        <td class="text-center">{{lineItem.displayAmount}}</td>
        {{#if canRemoveItems}}
          <td class="text-center">
            <a {{action 'deleteLineItem' lineItem}}>Remove</a>
          </td>
        {{/if}}
      </tr>
    {{/each}}
  </tbody>
</table>