diff --git a/app/assets/javascripts/darkswarm/controllers/registration_form_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/registration_form_controller.js.coffee index dc48bac9c5..e9073b8c1b 100644 --- a/app/assets/javascripts/darkswarm/controllers/registration_form_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/registration_form_controller.js.coffee @@ -1,20 +1,15 @@ Darkswarm.controller "RegistrationFormCtrl", ($scope, RegistrationService, EnterpriseRegistrationService) -> $scope.submitted = false + $scope.valid = (form) -> + $scope.submitted = !form.$valid + form.$valid + $scope.create = (form) -> - $scope.submitted = true - if form.$valid - EnterpriseRegistrationService.create() - $scope.submitted = false + EnterpriseRegistrationService.create() if $scope.valid(form) $scope.update = (nextStep, form) -> - $scope.submitted = true - if form.$valid - EnterpriseRegistrationService.update(nextStep) - $scope.submitted = false + EnterpriseRegistrationService.update(nextStep) if $scope.valid(form) $scope.select = (nextStep, form) -> - $scope.submitted = true - if form.$valid - RegistrationService.select(nextStep) - $scope.submitted = false \ No newline at end of file + RegistrationService.select(nextStep) if $scope.valid(form) \ No newline at end of file diff --git a/app/assets/javascripts/templates/registration/details.html.haml b/app/assets/javascripts/templates/registration/details.html.haml index 7991d0e01c..fc3a3a7798 100644 --- a/app/assets/javascripts/templates/registration/details.html.haml +++ b/app/assets/javascripts/templates/registration/details.html.haml @@ -5,15 +5,14 @@ %ng-include{ src: "'registration/steps.html'" } %form{ name: 'details', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "select('address',details)" } } .row - .small-12.columns + .small-12.columns.field %label{ for: 'enterprise_name' } Enterprise Name: %input.chunky.small-12.columns{ id: 'enterprise_name', name: 'name', placeholder: "eg. Charlie's Awesome Farm", required: true, ng: { model: 'enterprise.name' } } - {{ submitted + " " + details.name.$error.required }} %span.error.small-12.columns{ ng: { show: "details.name.$error.required && submitted" } } - You need to enter a name for you enterprise! + You need to enter a name for your enterprise! .row#enterprise-types{ 'data-equalizer' => true } - .small-12.columns + .small-12.columns.field .row .small-12.columns %label Choose one: diff --git a/app/assets/stylesheets/darkswarm/registration.css.sass b/app/assets/stylesheets/darkswarm/registration.css.sass index 70e6ef9a79..42db8f4aa1 100644 --- a/app/assets/stylesheets/darkswarm/registration.css.sass +++ b/app/assets/stylesheets/darkswarm/registration.css.sass @@ -34,10 +34,12 @@ top: 0px right: 0px + .field + margin-bottom: 15px + input.chunky padding: 8px font-size: 105% - margin-bottom: 15px label.indent-checkbox display: block