diff --git a/app/assets/javascripts/darkswarm/controllers/checkout/payment_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/checkout/payment_controller.js.coffee new file mode 100644 index 0000000000..ee5ff84b4a --- /dev/null +++ b/app/assets/javascripts/darkswarm/controllers/checkout/payment_controller.js.coffee @@ -0,0 +1,3 @@ +Darkswarm.controller "PaymentCtrl", ($scope) -> + angular.extend(this, new FieldsetMixin($scope)) + $scope.name = "payment" diff --git a/app/views/shop/checkout/_payment.html.haml b/app/views/shop/checkout/_payment.html.haml index e0efa6a165..78b0e9792f 100644 --- a/app/views/shop/checkout/_payment.html.haml +++ b/app/views/shop/checkout/_payment.html.haml @@ -1,19 +1,20 @@ %fieldset#payment - %accordion-group - %accordion-heading - .row - .large-6.columns - Payment Details - .large-6.columns.text-right - {{ Order.paymentMethod().name }} - - current_order.available_payment_methods.each do |method| - .row - .large-12.columns - %label - = radio_button_tag "order[payments_attributes][][payment_method_id]", method.id, false, - "ng-model" => "order.payment_method_id" - = method.name - .row{"ng-show" => "order.payment_method_id == #{method.id}"} - .large-12.columns - = render partial: "spree/checkout/payment/#{method.method_type}", :locals => { :payment_method => method } + %ng-form{"ng-controller" => "PaymentCtrl", name: "payment"} + %accordion-group + %accordion-heading + .row + .large-6.columns + Payment Details + .large-6.columns.text-right + {{ Order.paymentMethod().name }} + - current_order.available_payment_methods.each do |method| + .row + .large-12.columns + %label + = radio_button_tag "order[payments_attributes][][payment_method_id]", method.id, false, + "ng-model" => "order.payment_method_id" + = method.name + .row{"ng-show" => "order.payment_method_id == #{method.id}"} + .large-12.columns + = render partial: "spree/checkout/payment/#{method.method_type}", :locals => { :payment_method => method } diff --git a/app/views/shop/checkout/edit.html.haml b/app/views/shop/checkout/edit.html.haml index 5adefc5fdb..c3db3fddf6 100644 --- a/app/views/shop/checkout/edit.html.haml +++ b/app/views/shop/checkout/edit.html.haml @@ -8,13 +8,11 @@ %accordion.row{"close-others" => "true"} %checkout{"ng-controller" => "CheckoutCtrl"} - {{ order }} .large-9.columns - unless spree_current_user = render partial: "shop/checkout/authentication" .row = render partial: "shop/checkout/form" - .large-3.columns = render partial: "shop/checkout/summary"