diff --git a/app/assets/javascripts/darkswarm/services/order_cycle.js.coffee b/app/assets/javascripts/darkswarm/services/order_cycle.js.coffee index cdb98e9f7b..4c941df9e6 100644 --- a/app/assets/javascripts/darkswarm/services/order_cycle.js.coffee +++ b/app/assets/javascripts/darkswarm/services/order_cycle.js.coffee @@ -6,5 +6,4 @@ Shop.factory 'OrderCycle', ($resource, Product) -> @push_order_cycle: -> new $resource("/shop/order_cycle").save {order_cycle_id: @order_cycle.order_cycle_id}, -> - Product.update() - + Product.update() diff --git a/app/assets/stylesheets/darkswarm/header.css.scss b/app/assets/stylesheets/darkswarm/header.css.scss index 945966dfb7..e7df510621 100644 --- a/app/assets/stylesheets/darkswarm/header.css.scss +++ b/app/assets/stylesheets/darkswarm/header.css.scss @@ -1 +1,3 @@ /*body { background: #ff0000; }*/ + + diff --git a/app/views/shop/_order_cycles.html.haml b/app/views/shop/_order_cycles.html.haml index d48fb5149d..d99ec34d15 100644 --- a/app/views/shop/_order_cycles.html.haml +++ b/app/views/shop/_order_cycles.html.haml @@ -11,6 +11,6 @@ - else Ready for: %select{"ng-model" => "order_cycle.order_cycle_id", - "ng-init" => "order_cycle.order_cycle_id = #{current_order_cycle.id}", + "ng-init" => "order_cycle.order_cycle_id = #{current_order_cycle.andand.id}", "ng-change" => "changeOrderCycle()", "ng-options" => "c for c in #{@order_cycles.map {|oc| oc.id}.to_json}"} diff --git a/app/views/shop/show.html.haml b/app/views/shop/show.html.haml index f617e4ca9d..19467e091b 100644 --- a/app/views/shop/show.html.haml +++ b/app/views/shop/show.html.haml @@ -7,6 +7,10 @@ = @distributor.long_description.andand.html_safe %products{"ng-controller" => "ProductsCtrl"} + %product{"ng-repeat" => "product in data.products "} + {{ product.product.name }} + {{ product.product.description }} + %pre {{ data.products | json }} = render partial: "enterprises/contact_us" diff --git a/spec/javascripts/unit/darkswarm/controllers_spec.js.coffee b/spec/javascripts/unit/darkswarm/controllers_spec.js.coffee index 784973f175..0ea7488225 100644 --- a/spec/javascripts/unit/darkswarm/controllers_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/controllers_spec.js.coffee @@ -21,10 +21,6 @@ describe 'All controllers', -> it 'Fetches products from Product', -> expect(scope.data).toEqual 'testy mctest' - #it "updates products when the changeOrderCycle event is seen", -> - #spyOn(scope, "updateProducts") - #rootScope.$emit "changeOrderCycle" - #expect(scope.updateProducts).toHaveBeenCalled() describe 'OrderCycleCtrl', -> ctrl = null @@ -42,7 +38,3 @@ describe 'All controllers', -> scope = $rootScope.$new() ctrl = $controller 'OrderCycleCtrl', {$scope: scope} - #it "triggers an event when the order cycle changes", -> - #spyOn(rootScope, "$emit") - #scope.changeOrderCycle() - #expect(scope.$emit).toHaveBeenCalledWith "changeOrderCycle"