Commit 919b627597f877dbba1fda99069195a97d666932

Authored by Caio Almeida
1 parent 474fe554

Fixing view profile and edit profile

www/html/_left_sidebar.html
1 1 <div id="left-sidebar" class="sidebar" menu-toggle="left">
2 2 <ion-content>
3 3 <h2>
4   - <span>{{profile.login}}</span>
  4 + <span>{{profile.identifier}}</span>
5 5 <button menu-toggle="left" class="button button-icon icon ion-close-circled"></button>
6 6 </h2>
7 7 <ul class="list" ng-show="loggedIn">
... ...
www/html/_profile.html
... ... @@ -23,7 +23,7 @@
23 23 <h2>Etnia</h2>
24 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 28 </ion-content>
29 29 </div>
... ...
www/js/controllers.js
... ... @@ -1200,7 +1200,7 @@ angular.module(&#39;confjuvapp.controllers&#39;, [])
1200 1200 $scope.loadProfile = function() {
1201 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 1204 path = 'people/me/' + params;
1205 1205  
1206 1206 $http.get(ConfJuvAppUtils.pathTo(path))
... ... @@ -1252,13 +1252,23 @@ angular.module(&#39;confjuvapp.controllers&#39;, [])
1252 1252  
1253 1253 $scope.editProfile = function() {
1254 1254 if ($scope.editProfileModal) {
  1255 + if ($scope.profile.state) {
  1256 + $scope.loadCitiesByState($scope.profile.state.id);
  1257 + }
1255 1258 $scope.editProfileModal.show();
1256 1259 }
1257 1260 else {
1258 1261 if (!$scope.profile) {
1259 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 1272 if ($scope.signupPersonFields.length == 0) $scope.loadSignupPersonFields();
1263 1273 $ionicModal.fromTemplateUrl('html/_edit_profile.html', {
1264 1274 scope: $scope,
... ...