Create order page

This commit is contained in:
Ben Ramey
2014-03-14 11:57:59 -05:00
parent 6f3d47ff6e
commit da466969ba
7 changed files with 1373 additions and 6 deletions

View File

@@ -13,8 +13,9 @@ lunchApp.config ['$routeProvider',
.when '/run/:id',
templateUrl: 'templates/run.html',
controller: 'RunCtrl'
.otherwise
redirectTo: '/'
.when '/run/:id/order/:inviteeName',
templateUrl: 'templates/create-order.html',
controller: 'CreateOrderCtrl'
]
lunchApp.config ['$locationProvider',

View File

@@ -0,0 +1,11 @@
lunchControllers = angular.module 'lunchControllers'
lunchControllers.controller 'CreateOrderCtrl', ['$scope','socket','$routeParams', ($scope, socket, $routeParams) ->
$scope.show = false
socket.get '/run/' + $routeParams['id'],
(response) ->
$scope.show = true
$scope.invitee = _.find response.invitees, (i) -> i.name.toLowerCase() == $routeParams['inviteeName']
$scope.$apply()
]

View File

@@ -3,11 +3,9 @@ lunchControllers = angular.module 'lunchControllers'
lunchControllers.controller 'RunCtrl', ['$scope', 'socket', '$routeParams', ($scope, socket, $routeParams) ->
$scope.show = false
socket.get '/run',
where:
id: $routeParams['id'],
socket.get '/run/' + $routeParams['id'],
(response) ->
$scope.show = true
$scope.run = response[0]
$scope.run = response
$scope.$apply()
]

1344
assets/linker/js/vendor/underscore.js vendored Normal file

File diff suppressed because it is too large Load Diff