diff --git a/members/static/js/application_controllers.js b/members/static/js/application_controllers.js index 4e7a7bc..1e3aa7b 100644 --- a/members/static/js/application_controllers.js +++ b/members/static/js/application_controllers.js @@ -31,7 +31,7 @@ app.controller("applicationController", function($scope, $http, $location, $wind $scope.response = null; $scope.widgetId = null; $scope.model = { - key: '6LevHAcUAAAAAA45B7c-7qja-2aSwHztr9xb4K2Z' + key: "6LevHAcUAAAAAA45B7c-7qja-2aSwHztr9xb4K2Z" }; $scope.setResponse = function(response) { $scope.response = response; @@ -47,16 +47,17 @@ app.controller("applicationController", function($scope, $http, $location, $wind var valid; //server side validation $scope.member.reCaptchaResponse = vcRecaptchaService.getResponse() - if($scope.member.reCaptchaResponse === "") { + console.log($scope.member.reCaptchaResponse); + if($scope.member.reCaptchaResponse === "") { notyError("Ole hyvä ja täytä kuvavarmennus"); } else { $http.post("/members/api/request", $scope.member).then(function(data){ notySuccess("Hakemus lähetetty!"); - $window.location.href = "/application/"; + $window.location.href = "/application/success"; }, function(data){ notyError("Jokin meni vikaan. Yritä uudelleen."); vcRecaptchaService.reload($scope.widgetId); }); } } -}); \ No newline at end of file +}); diff --git a/members/templates/application_index.html b/members/templates/application_index.html index 2c54ac2..7457cc9 100644 --- a/members/templates/application_index.html +++ b/members/templates/application_index.html @@ -64,7 +64,7 @@
\ No newline at end of file + diff --git a/members/templates/application_success.html b/members/templates/application_success.html new file mode 100644 index 0000000..370a897 --- /dev/null +++ b/members/templates/application_success.html @@ -0,0 +1,15 @@ + + +
+ + + + + +
+ +
+