mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Do not show form until distribution has been chosen
This commit is contained in:
@@ -15,3 +15,6 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $compile, $attr
|
||||
$scope.orderCycleHasDistributor = (oc, distributor_id) ->
|
||||
distributor_ids = (d.id for d in oc.distributors)
|
||||
distributor_ids.indexOf(distributor_id) != -1
|
||||
|
||||
$scope.distributionChosen = ->
|
||||
$scope.distributor_id && $scope.order_cycle_id
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
add_to_attributes "table.index, [data-hook='admin_order_form_buttons']"
|
||||
attributes "ng-show" => "distributionChosen()"
|
||||
@@ -15,7 +15,8 @@
|
||||
= render 'spree/shared/error_messages', :target => @order
|
||||
|
||||
%div{"ng-app" => "admin.orders", "ng-controller" => "ordersCtrl"}
|
||||
= render 'add_product'
|
||||
%div{"ng-show" => "distributionChosen()"}
|
||||
= render 'add_product'
|
||||
|
||||
- unless @order.line_items.any?
|
||||
%div{"data-hook" => "admin_order_new_form"}
|
||||
|
||||
Reference in New Issue
Block a user