“Place order anyway” should be allowed for all address errors #2764

This commit is contained in:
Daniel Camargo 2014-04-03 10:57:00 -03:00
parent ae7fad6031
commit 641adeea13
4 changed files with 69 additions and 40 deletions

View File

@ -463,48 +463,66 @@
<div class="address-not-found-warning order-warning modal zoom-anim-dialog small-container mfp-hide">
<h1>Confirm your address?</h1>
<p><strong>We could not find the address:<br/>{{order.form.address}}</strong></p>
<ul>
<li>
<div ng-click="addressPlaceAnyway();">Continue</div>
</li>
<li>
<div ng-click="addressLetMeChangeIt();">Add a City or Zip Code</div>
</li>
</ul>
</div>
<div class="address-not-found-warning zoom-anim-dialog mfp-hide dialog" ng-controller="RestaurantClosedCtrl">
<div class="address-incomplete-warning order-warning zoom-anim-dialog mfp-hide dialog mfp-hide">
<div class="dialog-padding">
<h1>One sec!</h1>
<p><strong>We could not find the address:<br/>{{order.form.address}}</strong></p>
</div>
<div class="dialog-divider"></div>
<div class="dialog-padding dialog-bottom-buttons">
<div class="button-pushable"><button class="button lightorange" ng-click="addressLetMeChangeIt();">Add a City or Zip Code</button></div>
<a href="" ng-click="addressPlaceAnyway();" class="dialog-alternate-link">Place Order Anyway</a>
<div class="divider"></div>
<b class="order-warning-bold">Confirm your address?</b>
<p>It looks like your address is incomplete: <br/> {{order.form.address}}</p>
<div class="divider spacer-one-two"></div>
<ul>
<li>
<div class="button-pushable">
<button class="button lightorange" ng-click="addressLetMeChangeIt()">
Add a City or Zip Code
</button>
</div>
</li>
<li>
<div class="cursor link" ng-click="addressPlaceAnyway();">Place Order Anyway</div>
</li>
</ul>
</div>
</div>
<div class="address-out-of-range-warning zoom-anim-dialog mfp-hide dialog" ng-controller="RestaurantClosedCtrl">
<div class="address-not-found-warning order-warning zoom-anim-dialog mfp-hide dialog mfp-hide">
<div class="dialog-padding">
<h1>One sec!</h1>
<p>The address <strong>{{order.form.address}}</strong> is out of delivery range, or you have entered an invalid address.<br/><br/>Please check your address, or order takeout.</p>
<b class="order-warning-bold">Confirm your address?</b>
<p>We could not find the address: <br/> {{order.form.address}}</p>
<div class="divider spacer-one-two"></div>
<ul>
<li>
<div class="button-pushable">
<button class="button lightorange" ng-click="addressLetMeChangeIt()">
Add a City or Zip Code
</button>
</div>
</li>
<li>
<div class="cursor link" ng-click="addressPlaceAnyway();">Continue</div>
</li>
</ul>
</div>
<div class="dialog-divider"></div>
<div class="dialog-padding dialog-bottom-buttons">
<div class="button-pushable"><button class="button lightorange" ng-click="addressLetMeChangeIt();">Modify Address</button></div>
<a href="" ng-click="addressOutOfRangePlaceAnyway();" class="dialog-alternate-link">Place Order Anyway</a>
<div class="divider"></div>
</div>
<div class="address-out-of-range-warning order-warning zoom-anim-dialog mfp-hide dialog mfp-hide">
<div class="dialog-padding">
<b class="order-warning-bold">One sec!</b>
<p>The address <b>{{order.form.address}}</b> is out of delivery range, or you have entered an invalid address.<br/><br/>Please check your address, or order takeout.</p>
<div class="divider spacer-one-two"></div>
<ul>
<li>
<div class="button-pushable">
<button class="button lightorange" ng-click="addressLetMeChangeIt()">
Modify Address
</button>
</div>
</li>
<li>
<div class="cursor link" ng-click="addressPlaceAnyway();">Place Order Anyway</div>
</li>
</ul>
</div>
</div>
</div>

View File

@ -3511,13 +3511,13 @@ select {
margin-right: .4em;
}
.order-buttons .button, .account-modal .button.facebook {
.order-buttons .button, .account-modal .button.facebook, .order-warning.button {
padding-top: .6em;
padding-bottom: .6em;
}
.account-modal-bold {
.account-modal-bold, .order-warning-bold {
font-size: 1.1em;
}
@ -3531,7 +3531,7 @@ select {
float: right;
}
.account-modal .cursor{
.account-modal .cursor, .order-warning .cursor{
cursor: pointer;
text-decoration: underline;
}
@ -3546,11 +3546,21 @@ select {
text-transform: uppercase;
}
.order-warning .link,
.account-modal span.back-link,
.account-modal span.bottom-link{
color: #f06e35;
}
.order-warning-bold{
font-size: 1.2em;
}
.order-warning .link{
display: block;
margin-top: 1em;
}
.account-modal span.back-link{
margin-bottom: 1em;
text-decoration: none;

View File

@ -708,6 +708,7 @@ NGApp.controller( 'RestaurantCtrl', function ($scope, $http, $routeParams, $root
$scope.order.showForm = true;
$rootScope.closePopup();
}
$scope.addressLetMeChangeIt = function(){
$rootScope.closePopup();
$scope.order.showForm = true;

View File

@ -581,7 +581,7 @@ NGApp.factory( 'OrderService', function ($http, $location, $rootScope, $filter,
}
} else {
// Address was found but it is not valid (for example it could be a city name)
App.alert('It looks like your address is incomplete. <br>Please enter a street name, number, and city.');
App.dialog.show( '.address-incomplete-warning' );
App.busy.unBusy();
// Make sure that the form will be visible
$rootScope.$safeApply( function(){
@ -598,7 +598,7 @@ NGApp.factory( 'OrderService', function ($http, $location, $rootScope, $filter,
}
// Address not found!
var error = function () {
App.alert('It looks like your address is incomplete. <br>Please enter a street name, number, and city.');
App.dialog.show( '.address-incomplete-warning' );
App.busy.unBusy();
// Log the error
App.log.order({