diff --git a/app/assets/javascripts/darkswarm/controllers/order_cycle_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/order_cycle_controller.js.coffee index fc6413705a..3d8dc31fda 100644 --- a/app/assets/javascripts/darkswarm/controllers/order_cycle_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/order_cycle_controller.js.coffee @@ -1,5 +1,10 @@ -Darkswarm.controller "OrderCycleCtrl", ($scope, $rootScope, OrderCycle) -> +Darkswarm.controller "OrderCycleCtrl", ($scope, $rootScope, OrderCycle, $tour) -> $scope.order_cycle = OrderCycle.order_cycle $scope.OrderCycle = OrderCycle $scope.changeOrderCycle = -> + $tour.end() OrderCycle.push_order_cycle() + + if !OrderCycle.selected() + $tour.start() + diff --git a/app/assets/javascripts/darkswarm/services/order_cycle.js.coffee b/app/assets/javascripts/darkswarm/services/order_cycle.js.coffee index 58d4d11946..c7a4473b03 100644 --- a/app/assets/javascripts/darkswarm/services/order_cycle.js.coffee +++ b/app/assets/javascripts/darkswarm/services/order_cycle.js.coffee @@ -7,9 +7,8 @@ Darkswarm.factory 'OrderCycle', ($resource, Product, orderCycleData) -> Product.update() @orders_close_at: -> - if @order_cycle + if @selected() @order_cycle.orders_close_at - else - "" + @selected: -> - @order_cycle != null + @order_cycle != null and !$.isEmptyObject(@order_cycle) and @order_cycle.orders_close_at != undefined diff --git a/app/assets/javascripts/shared/mm-foundation-tpls-0.2.0-SNAPSHOT.js b/app/assets/javascripts/shared/mm-foundation-tpls-0.2.0-SNAPSHOT.js index fb1217f780..d4fb9527d8 100644 --- a/app/assets/javascripts/shared/mm-foundation-tpls-0.2.0-SNAPSHOT.js +++ b/app/assets/javascripts/shared/mm-foundation-tpls-0.2.0-SNAPSHOT.js @@ -2058,7 +2058,7 @@ angular.module( 'mm.foundation.tour', [ 'mm.foundation.position', 'mm.foundation }; }]) -.directive( 'stepText', [ '$position', '$tooltip', '$tour', '$window', function ( $position, $tooltip, $tour, $window ) { +.directive( 'step', [ '$position', '$tooltip', '$tour', '$window', function ( $position, $tooltip, $tour, $window ) { function isElementInViewport( element ) { var rect = element[0].getBoundingClientRect(); @@ -2092,6 +2092,7 @@ angular.module( 'mm.foundation.tour', [ 'mm.foundation.position', 'mm.foundation return $tooltip( 'step', 'step', show ); }]); + angular.module('mm.foundation.typeahead', ['mm.foundation.position', 'mm.foundation.bindHtml']) /** @@ -2602,7 +2603,7 @@ angular.module("template/tour/tour.html", []).run(["$templateCache", function($t "

\n" + "

\n" + " Next\n" + - " End\n" + + //" Close\n" + " ×\n" + " \n" + "\n" + diff --git a/app/views/shop/shop/show.html.haml b/app/views/shop/shop/show.html.haml index df054840da..62d25b9670 100644 --- a/app/views/shop/shop/show.html.haml +++ b/app/views/shop/shop/show.html.haml @@ -1,12 +1,13 @@ %shop.darkswarm - content_for :order_cycle_form do + %strong.avenir Ready for %select.avenir#order_cycle_id{"ng-model" => "order_cycle.order_cycle_id", "ng-change" => "changeOrderCycle()", - "ng-options" => "oc.id as oc.time for oc in #{@order_cycles.map {|oc| {time: pickup_time(oc), id: oc.id}}.to_json}"} + "ng-options" => "oc.id as oc.time for oc in #{@order_cycles.map {|oc| {time: pickup_time(oc), id: oc.id}}.to_json}", + step: "Please select an order cycle", "step-index" => "1","step-placement" => "bottom", "step-append-to-body" => "true"} - %closing - -#%img{src: "/icon/goes/here"} + %closing{"ng-if" => "OrderCycle.selected()"} Orders close %strong {{ OrderCycle.orders_close_at() | date_in_words }} = render partial: "shop/details"