Angularise edit order form

This commit is contained in:
Rohan Mitchell
2015-12-04 09:03:44 +11:00
parent 6e7b6b5dfc
commit cbaf2a0cb3
3 changed files with 13 additions and 6 deletions

View File

@@ -1,4 +1,7 @@
angular.module("admin.orders").controller "ordersCtrl", ($scope, $compile, shops, orderCycles) ->
angular.module("admin.orders").controller "ordersCtrl", ($scope, $compile, $attrs, shops, orderCycles) ->
$scope.$compile = $compile
$scope.shops = shops
$scope.orderCycles = orderCycles
$scope.distributor_id = $attrs.ofnDistributorId
$scope.order_cycle_id = $attrs.ofnOrderCycleId

View File

@@ -10,7 +10,7 @@ Spree::Admin::OrdersController.class_eval do
# in an auth failure as the @order object is nil for collection actions
before_filter :check_authorization, except: [:bulk_management, :managed]
before_filter :load_distribution_choices, only: :new
before_filter :load_distribution_choices, only: [:new, :edit]
# After updating an order, the fees should be updated as well
# Currently, adding or deleting line items does not trigger updating the

View File

@@ -5,16 +5,20 @@
%li= button_link_to t(:resend), resend_admin_order_url(@order), method: :post, icon: 'icon-email'
%li= button_link_to t(:back_to_orders_list), admin_orders_path, icon: 'icon-arrow-left'
= admin_inject_shops 'admin.orders'
= admin_inject_order_cycles
= render 'spree/admin/shared/order_tabs', current: 'Order Details'
%div{"data-hook" => "admin_order_edit_header"}
= render 'spree/shared/error_messages', target: @order
= render 'add_product'
%div{"ng-app" => "admin.orders", "ng-controller" => "ordersCtrl", "ofn-distributor-id" => @order.distributor_id, "ofn-order-cycle-id" => @order.order_cycle_id}
= render 'add_product'
%div{"data-hook" => "admin_order_edit_form"}
#order-form-wrapper
= render 'form', order: @order
%div{"data-hook" => "admin_order_edit_form"}
#order-form-wrapper
= render 'form', order: @order
- content_for :head do
= javascript_tag 'var expand_variants = true;'