Rewriting small cart, so that it doesn't break all of the dropdowns on the page (can't use .row within li elements it seems...)

This commit is contained in:
Rob Harrington
2015-03-06 19:03:46 +11:00
parent 12c6878cbe
commit 0a300d1802
2 changed files with 43 additions and 38 deletions

View File

@@ -20,21 +20,27 @@
right: 22px !important
left: auto
ul, li
list-style: none
margin-left: 0
table
width: 100%
border: none
border-spacing: 0px
margin-bottom: 5px
li
float: none
.row .columns
padding-left: 0.25rem
padding-right: 0.25rem
li.total-cart
background-color: #424242
li.product-cart
border-top: 1px solid #424242
tr.total-cart
color: #fff
background-color: #424242
td
color: #fff
tr.product-cart
background-color: #333333
border-top: 1px solid #424242
td
padding: 4px 12px
color: #fff
.buttons
.button
height: auto
top: 0px
#cart-detail
.cart-item-delete

View File

@@ -10,34 +10,33 @@
%span.joyride-nub.top
.joyride-content-wrapper
%h5 Your shopping cart
%ul
%li.product-cart{"ng-repeat" => "line_item in Cart.line_items_present()",
%table
%tr.product-cart{"ng-repeat" => "line_item in Cart.line_items_present()",
"ng-controller" => "LineItemCtrl", "id" => "cart-variant-{{ line_item.variant.id }}"}
.row
.columns.small-7
%small
%strong {{ line_item.variant.name_to_display }}
%em {{ line_item.variant.unit_to_display }}
.columns.small-3.text-right
%small
%span.quantity {{ line_item.quantity }}
%i.ofn-i_009-close
%span.price {{ line_item.variant.price_with_fees | localizeCurrency }}
%td
%small
%strong {{ line_item.variant.name_to_display }}
%em {{ line_item.variant.unit_to_display }}
%td.text-right
%small
%span.quantity {{ line_item.quantity }}
%i.ofn-i_009-close
%span.price {{ line_item.variant.price_with_fees | localizeCurrency }}
.columns.small-2
%small
\=
%strong
.total-price.right {{ line_item.variant.totalPrice() | localizeCurrency }}
%td
%small
\=
%strong
.total-price.right {{ line_item.variant.totalPrice() | localizeCurrency }}
%li.total-cart{"ng-show" => "Cart.line_items_present().length > 0"}
.row
.columns.small-6
%em Total:
.columns.small-6.text-right
%strong {{ Cart.total() | localizeCurrency }}
%table{"ng-show" => "Cart.line_items_present().length > 0"}
%tr.total-cart
%td
%em Total:
%td.text-right
%strong {{ Cart.total() | localizeCurrency }}
.text-right
.buttons.text-right
%a.button.secondary.tiny.add_to_cart{ href: cart_path, type: :submit, "ng-disabled" => "Cart.dirty || Cart.empty()", "ng-class" => "{ dirty: Cart.dirty }" }
{{ Cart.dirty ? 'Updating cart...' : (Cart.empty() ? 'Cart empty' : 'Edit your cart' ) }}
%a.button.primary.tiny{href: checkout_path, "ng-disabled" => "Cart.dirty || Cart.empty()"} Checkout now