From 2195512161a34a63891cc9c1845ee0dfb0548a4e Mon Sep 17 00:00:00 2001 From: Caio SBA Date: Tue, 20 Oct 2015 05:24:10 -0300 Subject: [PATCH] Ticket #132: Check profile completeness --- www/html/_edit_profile.html | 2 +- www/html/_profile.html | 2 -- www/js/controllers.js | 8 ++++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/www/html/_edit_profile.html b/www/html/_edit_profile.html index 5824b24..3ddb61d 100644 --- a/www/html/_edit_profile.html +++ b/www/html/_edit_profile.html @@ -12,7 +12,7 @@ - + diff --git a/www/html/_profile.html b/www/html/_profile.html index 8e47a54..93b5f9f 100644 --- a/www/html/_profile.html +++ b/www/html/_profile.html @@ -18,7 +18,6 @@

Suas Medalhas

-

Nome

{{profile.name}}

diff --git a/www/js/controllers.js b/www/js/controllers.js index 3df406b..26948b6 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -1441,7 +1441,7 @@ angular.module('confjuvapp.controllers', []) } if ($scope.signupPersonFields.length == 0) $scope.loadSignupPersonFields(); - $ionicModal.fromTemplateUrl('html/_edit_profile.html?1', { + $ionicModal.fromTemplateUrl('html/_edit_profile.html?2', { scope: $scope, animation: 'slide-in-up' }).then(function(modal) { @@ -1491,6 +1491,7 @@ angular.module('confjuvapp.controllers', []) popup.then(function() { $scope.loading = false; $scope.closeEditProfile(); + $scope.checkCompleteness(profile); }); $scope.loading = false; }, function(err) { @@ -1502,7 +1503,10 @@ angular.module('confjuvapp.controllers', []) $scope.profileComplete = true; $scope.hideProfileWarning = !!window.localStorage['hide_profile_warning']; $scope.checkCompleteness = function(p) { - if (!!!p.name || !!!p.orientacao_sexual || !!!p.identidade_genero || !!!p.etnia || !!!p.city || !!!p.membro_conselho) { + if (!!p.name && !!p.orientacao_sexual && !!p.identidade_genero && !!p.etnia && !!p.membro_conselho && (!!p.region || !!p.city)) { + $scope.profileComplete = true; + } + else { $scope.profileComplete = false; } }; -- libgit2 0.21.2