added custom restaurant closed dialog
This commit is contained in:
parent
72b76ff7e7
commit
4ccdd9fe22
@ -0,0 +1,7 @@
|
||||
<div class="restaurant-closed-container zoom-anim-dialog small-container mfp-hide" ng-controller="RestaurantClosedCtrl">
|
||||
<div class="signin-form-container">
|
||||
<h1 ng-bind="restaurant.name"></h1>
|
||||
<p>Is currently closed. It will be open during the following hours (<span ng-bind="restaurant._tzabbr"></span>):<br /><br />
|
||||
<div ng-bind-html-unsafe="restaurant.closedMessage()"</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -163,6 +163,7 @@ TODO: remove this comment
|
||||
<div class="divider"></div>
|
||||
</div>
|
||||
|
||||
<div ng-include="'assets/view/restaurant.closed.html'"></div>
|
||||
<div ng-include="'assets/view/account.html'"></div>
|
||||
<div ng-include="'assets/view/account.reset.html'"></div>
|
||||
<div ng-include="'assets/view/account.facebook.html'"></div>
|
||||
|
||||
@ -44,6 +44,22 @@ function RecommendRestaurantCtrl( $scope, $http, RecommendRestaurantService, Acc
|
||||
$scope.modal = AccountModalService;
|
||||
}
|
||||
|
||||
function RestaurantClosedCtrl($scope, $rootScope) {
|
||||
|
||||
|
||||
$rootScope.$on('restaurantClosedClick', function(e, r) {
|
||||
if ($scope.$$phase) {
|
||||
$scope.restaurant = r;
|
||||
App.dialog.show('.restaurant-closed-container');
|
||||
} else {
|
||||
$rootScope.$apply(function(scope) {
|
||||
scope.restaurant = r;
|
||||
App.dialog.show('.restaurant-closed-container');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function RecommendFoodCtrl( $scope, $http, RecommendFoodService ) {
|
||||
$scope.recommend = RecommendFoodService;
|
||||
}
|
||||
|
||||
@ -76,16 +76,16 @@ NGApp.controller('default', function ($scope, $http, $location, CommunityAliasSe
|
||||
/**
|
||||
* Show the restaurants
|
||||
*/
|
||||
NGApp.controller( 'restaurants', function ( $scope, $http, $location, RestaurantsService ) {
|
||||
NGApp.controller( 'restaurants', function ( $scope, $http, $location, RestaurantsService) {
|
||||
|
||||
$scope.mealItemClass = App.isAndroid() ? 'meal-food-android' : '';
|
||||
|
||||
$scope.restaurants = RestaurantsService;
|
||||
|
||||
|
||||
$scope.display = function() {
|
||||
if ( !this.restaurant.open() ) {
|
||||
App.alert("This restaurant is currently closed. It will be open during the following hours (" + this.restaurant._tzabbr + "):\n\n" + this.restaurant.closedMessage());
|
||||
App.busy.unBusy();
|
||||
App.rootScope.$broadcast('restaurantClosedClick', this.restaurant);
|
||||
} else {
|
||||
$location.path('/' + App.restaurants.permalink + '/' + this.restaurant.permalink);
|
||||
}
|
||||
|
||||
@ -358,7 +358,7 @@ var Restaurant = function(id) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return ordered.join( '\n' );
|
||||
return ordered.join( '<br>' );
|
||||
}
|
||||
|
||||
self.preset = function() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user