Commit 919b627597f877dbba1fda99069195a97d666932

Authored by Caio Almeida
1 parent 474fe554

Fixing view profile and edit profile

www/html/_left_sidebar.html
1 <div id="left-sidebar" class="sidebar" menu-toggle="left"> 1 <div id="left-sidebar" class="sidebar" menu-toggle="left">
2 <ion-content> 2 <ion-content>
3 <h2> 3 <h2>
4 - <span>{{profile.login}}</span> 4 + <span>{{profile.identifier}}</span>
5 <button menu-toggle="left" class="button button-icon icon ion-close-circled"></button> 5 <button menu-toggle="left" class="button button-icon icon ion-close-circled"></button>
6 </h2> 6 </h2>
7 <ul class="list" ng-show="loggedIn"> 7 <ul class="list" ng-show="loggedIn">
www/html/_profile.html
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 <h2>Etnia</h2> 23 <h2>Etnia</h2>
24 <p>{{profile.etnia | etniaFilter}}</p> 24 <p>{{profile.etnia | etniaFilter}}</p>
25 25
26 - <h2><span ng-show="profile.transgenero == 'false'">Não</span> Sou transgênero</h2> 26 + <h2><span ng-show="profile.transgenero == 'false'">Não</span> Sou Transgênero</h2>
27 27
28 </ion-content> 28 </ion-content>
29 </div> 29 </div>
www/js/controllers.js
@@ -1200,7 +1200,7 @@ angular.module(&#39;confjuvapp.controllers&#39;, []) @@ -1200,7 +1200,7 @@ angular.module(&#39;confjuvapp.controllers&#39;, [])
1200 $scope.loadProfile = function() { 1200 $scope.loadProfile = function() {
1201 $scope.loading = true; 1201 $scope.loading = true;
1202 1202
1203 - var params = '?private_token=' + ConfJuvAppUtils.getPrivateToken(), 1203 + var params = '?private_token=' + ConfJuvAppUtils.getPrivateToken() + '&t=' + (new Date().getTime()),
1204 path = 'people/me/' + params; 1204 path = 'people/me/' + params;
1205 1205
1206 $http.get(ConfJuvAppUtils.pathTo(path)) 1206 $http.get(ConfJuvAppUtils.pathTo(path))
@@ -1252,13 +1252,23 @@ angular.module(&#39;confjuvapp.controllers&#39;, []) @@ -1252,13 +1252,23 @@ angular.module(&#39;confjuvapp.controllers&#39;, [])
1252 1252
1253 $scope.editProfile = function() { 1253 $scope.editProfile = function() {
1254 if ($scope.editProfileModal) { 1254 if ($scope.editProfileModal) {
  1255 + if ($scope.profile.state) {
  1256 + $scope.loadCitiesByState($scope.profile.state.id);
  1257 + }
1255 $scope.editProfileModal.show(); 1258 $scope.editProfileModal.show();
1256 } 1259 }
1257 else { 1260 else {
1258 if (!$scope.profile) { 1261 if (!$scope.profile) {
1259 $scope.loadProfile(); 1262 $scope.loadProfile();
1260 } 1263 }
1261 - if ($scope.states.length == 0) $scope.loadStates(); 1264 +
  1265 + if ($scope.states.length == 0) {
  1266 + $scope.loadStates();
  1267 + }
  1268 + else if ($scope.profile.state) {
  1269 + $scope.loadCitiesByState($scope.profile.state.id);
  1270 + }
  1271 +
1262 if ($scope.signupPersonFields.length == 0) $scope.loadSignupPersonFields(); 1272 if ($scope.signupPersonFields.length == 0) $scope.loadSignupPersonFields();
1263 $ionicModal.fromTemplateUrl('html/_edit_profile.html', { 1273 $ionicModal.fromTemplateUrl('html/_edit_profile.html', {
1264 scope: $scope, 1274 scope: $scope,