Adding payment controller for consistency

This commit is contained in:
Will Marshall
2014-04-10 16:35:03 +10:00
parent 5f62cb7ddb
commit acd8d2d8a2
3 changed files with 21 additions and 19 deletions

View File

@@ -0,0 +1,3 @@
Darkswarm.controller "PaymentCtrl", ($scope) ->
angular.extend(this, new FieldsetMixin($scope))
$scope.name = "payment"

View File

@@ -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 }

View File

@@ -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"