diff --git a/app/assets/javascripts/darkswarm/directives/shop_variant.js.coffee b/app/assets/javascripts/darkswarm/directives/shop_variant.js.coffee deleted file mode 100644 index 372a92b69d..0000000000 --- a/app/assets/javascripts/darkswarm/directives/shop_variant.js.coffee +++ /dev/null @@ -1,7 +0,0 @@ -angular.module('Darkswarm').directive "shopVariant", -> - restrict: 'E' - replace: true - templateUrl: 'shop_variant.html' - scope: - variant: '=' - controller: 'ShopVariantCtrl' diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index bccaf6e334..18471ead25 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -13,7 +13,8 @@ %product.animate-repeat{"ng-controller" => "ProductNodeCtrl", "ng-repeat" => "product in Products.products track by product.id", "id" => "product-{{ product.id }}"} = render "shop/products/summary" .shop-variants - %shop-variant{variant: 'variant', "ng-repeat" => "variant in product.variants | orderBy: ['name_to_display','unit_value'] track by variant.id", "id" => "variant-{{ variant.id }}", "ng-class" => "{'out-of-stock': !variant.on_demand && variant.on_hand == 0}"} + .variants.row{"ng-controller": "ShopVariantCtrl", variant: 'variant', "ng-repeat" => "variant in product.variants | orderBy: ['name_to_display','unit_value'] track by variant.id", "id" => "variant-{{ variant.id }}", "ng-class" => "{'out-of-stock': !variant.on_demand && variant.on_hand == 0}"} + = render "shop/products/shop_variant" %product{"ng-show" => "Products.loading"} .summary .small-12.columns.text-center diff --git a/app/views/shop/products/_shop_variant.html.haml b/app/views/shop/products/_shop_variant.html.haml index 819622d982..63d5f05090 100644 --- a/app/views/shop/products/_shop_variant.html.haml +++ b/app/views/shop/products/_shop_variant.html.haml @@ -1,23 +1,22 @@ -.variants.row - .small-4.medium-4.large-5.columns.variant-name - .inline{"ng-if" => "::variant.display_name"} {{ ::variant.display_name }} - .variant-unit {{ ::variant.unit_to_display }} - .small-3.medium-3.large-2.columns.variant-price - %price-breakdown{"price-breakdown" => "_", variant: "variant", - "price-breakdown-append-to-body" => "true", - "price-breakdown-placement" => "bottom", - "price-breakdown-animation" => true} - {{ variant.price_with_fees | localizeCurrency }} - .unit-price.variant-unit-price - %question-mark-with-tooltip{"question-mark-with-tooltip" => "_", - "question-mark-with-tooltip-append-to-body" => "true", - "question-mark-with-tooltip-placement" => "top", - "question-mark-with-tooltip-animation" => true, - key: "'js.shopfront.unit_price_tooltip'"} - {{ variant.unit_price_price | localizeCurrency }} / {{ variant.unit_price_unit }} - - .medium-2.large-2.columns.total-price - %span{"ng-class" => "{filled: variant.line_item.total_price}"} - {{ variant.line_item.total_price | localizeCurrency }} - = render partial: "shop/products/shop_variant_no_group_buy" - = render partial: "shop/products/shop_variant_with_group_buy" +.small-4.medium-4.large-5.columns.variant-name + .inline{"ng-if" => "::variant.display_name"} {{ ::variant.display_name }} + .variant-unit {{ ::variant.unit_to_display }} +.small-3.medium-3.large-2.columns.variant-price + %price-breakdown{"price-breakdown" => "_", variant: "variant", + "price-breakdown-append-to-body" => "true", + "price-breakdown-placement" => "bottom", + "price-breakdown-animation" => true} + {{ variant.price_with_fees | localizeCurrency }} + .unit-price.variant-unit-price + %question-mark-with-tooltip{"question-mark-with-tooltip" => "_", + "question-mark-with-tooltip-append-to-body" => "true", + "question-mark-with-tooltip-placement" => "top", + "question-mark-with-tooltip-animation" => true, + key: "'js.shopfront.unit_price_tooltip'"} + {{ variant.unit_price_price | localizeCurrency }} / {{ variant.unit_price_unit }} + +.medium-2.large-2.columns.total-price + %span{"ng-class" => "{filled: variant.line_item.total_price}"} + {{ variant.line_item.total_price | localizeCurrency }} += render partial: "shop/products/shop_variant_no_group_buy" += render partial: "shop/products/shop_variant_with_group_buy"