diff --git a/services/web/app/views/subscriptions/new.jade b/services/web/app/views/subscriptions/new.jade index fde06d571c..7c2c65cc25 100644 --- a/services/web/app/views/subscriptions/new.jade +++ b/services/web/app/views/subscriptions/new.jade @@ -128,22 +128,22 @@ block content hr .row .col-md-12 - .form-group + .form-group(ng-class="validation.errorFields.address1 ? 'has-error' : ''") label #{translate("billing_address")} input.form-control(type='text', value='', maxlength='255', tabindex='1', onkeyup='', ng-model="data.address1", placeholder="#{translate('address')}") - .form-group + .form-group(ng-class="validation.errorFields.address2 ? 'has-error' : ''") input.form-control(type='text', value='', maxlength='255', tabindex='1', onkeyup='', ng-model="data.address2", placeholder="#{translate('address')}") - .form-group + .form-group(ng-class="validation.errorFields.state ? 'has-error' : ''") input.form-control(type='text', value='', maxlength='255', tabindex='1', onkeyup='', ng-model="data.state", placeholder="#{translate('state')}") .row .col-md-7 - .form-group + .form-group(ng-class="validation.errorFields.city ? 'has-error' : ''") input.form-control(type='text', value='', maxlength='255', tabindex='1', onkeyup='', data-recurly="city", ng-model="data.city", placeholder="#{translate('city')}") - .col-md-5 + .col-md-5(ng-class="validation.errorFields.postal_code ? 'has-error' : ''") input.form-control(type='text', value='', maxlength='255', tabindex='1', onkeyup='', data-recurly="postal_code", ng-model="data.postal_code", placeholder="#{translate('zip_post_code')}") .row .col-md-7 - .form-group + .form-group(ng-class="validation.errorFields.country ? 'has-error' : ''") select.form-control(data-recurly="country", ng-model="data.country", ng-change="updateCountry()", required) mixin countries_options() .row diff --git a/services/web/public/coffee/main/new-subscription.coffee b/services/web/public/coffee/main/new-subscription.coffee index 60d032fbe4..a67e5fc034 100644 --- a/services/web/public/coffee/main/new-subscription.coffee +++ b/services/web/public/coffee/main/new-subscription.coffee @@ -81,9 +81,10 @@ define [ completeSubscription = (err, recurly_token_id) -> $scope.validation.errorFields = {} if err? - $scope.processing = false - $scope.genericError = err.message - _.each err.fields, (field)-> $scope.validation.errorFields[field] = true + $scope.$apply () -> + $scope.processing = false + $scope.genericError = err.message + _.each err.fields, (field)-> $scope.validation.errorFields[field] = true else postData = _csrf: window.csrfToken @@ -92,10 +93,10 @@ define [ currencyCode:pricing.items.currency plan_code:pricing.items.plan.code $http.post("/user/subscription/create", postData) - .success (data, status, headers)-> - window.location.href = "/user/subscription/thank-you" - .error (data, status, headers)-> - $scope.processing = false + .success (data, status, headers)-> + window.location.href = "/user/subscription/thank-you" + .error (data, status, headers)-> + $scope.processing = false $scope.genericError = "Something went wrong processing the request" $scope.submit = ->