Menu and other's orders sidebars on udpate order page
This commit is contained in:
@@ -17,8 +17,8 @@ lunchApp.config ['$routeProvider',
|
||||
templateUrl: 'templates/run/show.html',
|
||||
controller: 'RunCtrl'
|
||||
.when '/order/:inviteeId',
|
||||
templateUrl: 'templates/run/create-order.html',
|
||||
controller: 'CreateOrderCtrl'
|
||||
templateUrl: 'templates/invitee/update-order.html',
|
||||
controller: 'UpdateOrderCtrl'
|
||||
.otherwise
|
||||
redirectTo: '/home'
|
||||
]
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
lunchControllers = angular.module 'lunchControllers'
|
||||
|
||||
lunchControllers.controller 'CreateOrderCtrl', ['$scope','socket','$routeParams','$location',
|
||||
CreateOrderController = ($scope, socket, $routeParams, $location) ->
|
||||
lunchControllers.controller 'UpdateOrderCtrl', ['$scope','socket','$routeParams','$location','$sce',
|
||||
UpdateOrderController = ($scope, socket, $routeParams, $location, $sce) ->
|
||||
$scope.show = false
|
||||
$scope.showMenuUrl = false
|
||||
$scope.invitees = []
|
||||
$scope.menuUrl = ''
|
||||
|
||||
socket.get '/invitee/findOne', id: $routeParams['inviteeId'], (inviteeResponse) ->
|
||||
$scope.invitee = inviteeResponse
|
||||
@@ -12,9 +14,14 @@ lunchControllers.controller 'CreateOrderCtrl', ['$scope','socket','$routeParams'
|
||||
(runResponse) ->
|
||||
$scope.show = true
|
||||
$scope.showMenuUrl = runResponse.menuUrl
|
||||
$scope.menuUrl = $sce.trustAsResourceUrl(runResponse.menuUrl)
|
||||
$scope.run = runResponse
|
||||
$scope.$apply()
|
||||
|
||||
socket.get '/invitee/find', run_id: inviteeResponse.run_id, (allResponse) ->
|
||||
$scope.invitees = allResponse
|
||||
$scope.$apply()
|
||||
|
||||
$scope.submit = (invitee) ->
|
||||
socket.put '/invitee/' + $routeParams['inviteeId'], { order: invitee.order }, (response) ->
|
||||
$location.path '/run/' + $scope.run.id
|
||||
@@ -5,6 +5,7 @@
|
||||
@import "run.less";
|
||||
@import "nav.less";
|
||||
@import "header-footer.less";
|
||||
@import "update-order.less";
|
||||
|
||||
body {
|
||||
color: #fff;
|
||||
|
||||
6
assets/linker/styles/update-order.less
Normal file
6
assets/linker/styles/update-order.less
Normal file
@@ -0,0 +1,6 @@
|
||||
.others-orders {
|
||||
.list-group-item {
|
||||
border-width: 0 0 1px 0;
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
38
assets/linker/templates/invitee/update-order.jade
Normal file
38
assets/linker/templates/invitee/update-order.jade
Normal file
@@ -0,0 +1,38 @@
|
||||
extends ../layouts/interior-page
|
||||
|
||||
block pagetitle
|
||||
span.glyphicon.glyphicon-list
|
||||
span.text-muted Enter your order for:
|
||||
| {{ run.name }}
|
||||
|
||||
block interiorcontent
|
||||
div(ng-show='show')
|
||||
p Hi {{ invitee.name }}! You are all going to {{ run.restaurant }}.
|
||||
span(ng-show='showMenuUrl') Here is the
|
||||
a(href='{{ run.menuUrl }}',target="_blank") menu.
|
||||
|
||||
.row
|
||||
.col-xs-12.col-sm-6
|
||||
h2 Update your order
|
||||
form.form.create-order-form(role='form')
|
||||
div.form-group
|
||||
textarea#order.form-control(ng-model='invitee.order',placeholder='Your order',rows=8)
|
||||
|
||||
button.btn.btn-lg.btn-primary.btn-block(ng-click='submit(invitee)') Submit Order
|
||||
|
||||
.col-xs-12.col-sm-6
|
||||
div.pod(ng-show='showMenuUrl')
|
||||
h2
|
||||
| Menu
|
||||
a.btn.btn-sm.btn-default.pull-right(href='{{ run.menuUrl }}',target='_blank')
|
||||
span.glyphicon.glyphicon-new-window
|
||||
|
||||
iframe(ng-src='{{ menuUrl }}',width='100%',height='400px')
|
||||
|
||||
div.pod.others-orders
|
||||
h2 Other's orders
|
||||
ul.list-group(ng-repeat='i in invitees')
|
||||
li.list-group-item
|
||||
strong {{ i.name }}
|
||||
| : {{ i.order }}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
extends ../layouts/interior-page
|
||||
|
||||
block pagetitle
|
||||
span.glyphicon.glyphicon-list
|
||||
span.text-muted Enter your order for:
|
||||
| {{ run.name }}
|
||||
|
||||
block interiorcontent
|
||||
div(ng-show='show')
|
||||
p Hi {{ invitee.name }}! You are all going to {{ run.restaurant }}.
|
||||
span(ng-show='showMenuUrl') Here is the
|
||||
a(href='{{ run.menuUrl }}',target="_blank") menu.
|
||||
|
||||
form.form.create-order-form(role='form')
|
||||
div.form-group
|
||||
textarea#order.form-control(ng-model='invitee.order',placeholder='Your order')
|
||||
|
||||
button.btn.btn-lg.btn-primary.btn-block(ng-click='submit(invitee)') Submit Order
|
||||
Reference in New Issue
Block a user