Getting in notification to select order cycle

This commit is contained in:
Will Marshall
2014-04-07 13:14:32 +10:00
parent 5c999fd9cf
commit 1c22a2c848
4 changed files with 16 additions and 10 deletions

View File

@@ -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()

View File

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

View File

@@ -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
" <h4 ng-bind=\"title\" ng-show=\"title\"></h4>\n" +
" <p ng-bind=\"content\"></p>\n" +
" <a class=\"small button joyride-next-tip\" ng-show=\"!isLastStep()\" ng-click=\"nextStep()\">Next</a>\n" +
" <a class=\"small button joyride-next-tip\" ng-show=\"isLastStep()\" ng-click=\"endTour()\">End</a>\n" +
//" <a class=\"small button joyride-next-tip\" ng-show=\"isLastStep()\" ng-click=\"endTour()\">Close</a>\n" +
" <a class=\"joyride-close-tip\" ng-click=\"endTour()\">&times;</a>\n" +
" </div>\n" +
"</div>\n" +

View File

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