Skip to content

Commit

Permalink
Implemented success page for user registration.
Browse files Browse the repository at this point in the history
  • Loading branch information
vzickner committed Nov 21, 2015
1 parent 196077b commit c3084d7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
5 changes: 5 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ angular.module('Come2HelpApp', [
controller: 'RegisterController',
controllerAs: 'ctrl'
}).
when('/register/done', {
templateUrl: 'partials/registerDone.html',
controller: 'RegisterDoneController',
controllerAs: 'ctrl'
}).
otherwise({
redirectTo: '/register'
});
Expand Down
6 changes: 4 additions & 2 deletions js/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ angular.module('Come2HelpApp').config(['$translateProvider', function ($translat
'Phone': 'Phone',
'Is Adult': 'Is Adult',
'Abilities': 'Abilities',
'Please correct the highlighted fields.': 'Please correct the highlighted fields.'
'Please correct the highlighted fields.': 'Please correct the highlighted fields.',
'Thank you for register!': 'Thank you for register!'
});

$translateProvider.translations('de', {
Expand All @@ -38,7 +39,8 @@ angular.module('Come2HelpApp').config(['$translateProvider', function ($translat
'Phone': 'Telefonnummer',
'Is Adult': 'Volljährig?',
'Abilities': 'Fähigkeiten',
'Please correct the highlighted fields.': 'Bitte korrigiere die hervorgebenen Felder.'
'Please correct the highlighted fields.': 'Bitte korrigiere die hervorgebenen Felder.',
'Thank you for register!': 'Danke für die Registrierung!'
});

$translateProvider.fallbackLanguage('en')
Expand Down
15 changes: 12 additions & 3 deletions js/register.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module('Come2HelpController').controller('RegisterController', ['Abilities', 'Volunteers', '$routeParams', function (Abilities, Volunteers, $routeParams) {
angular.module('Come2HelpController').controller('RegisterController', ['Abilities', 'Volunteers', '$routeParams', '$location', function (Abilities, Volunteers, $routeParams, $location) {
var vm = this;

vm.errors = null;
Expand All @@ -20,8 +20,13 @@ angular.module('Come2HelpController').controller('RegisterController', ['Abiliti
}, function() {
vm.errors = null;

vm.givenName = '';
vm.surname = '';
vm.zipCode = '';
vm.phone = '';
vm.adult = null;

// TODO: Clear form and send to ``thank you''-page
$location.path('/register/done');
}, function (response) {
vm.errors = {};

Expand All @@ -31,4 +36,8 @@ angular.module('Come2HelpController').controller('RegisterController', ['Abiliti
}
});
};
}]);
}]);

angular.module('Come2HelpController').controller('RegisterDoneController', function () {

});
4 changes: 4 additions & 0 deletions partials/registerDone.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="jumbotron">
<h1>{{ 'Thank you for register!' | translate }}</h1>
<p>{{ 'We will contact you ...' | translate }}</p>
</div>

0 comments on commit c3084d7

Please sign in to comment.