Profile - Edit And Delete Buttons Visible Only If Permitted

This commit is contained in:
Sagi Dayan 2015-06-26 15:34:07 +03:00
parent cc3d65037d
commit 1d5cbb18cd
2 changed files with 4 additions and 6 deletions

View file

@ -91,9 +91,7 @@ angular.module('SeHub')
[28, 48, 40, 3] [28, 48, 40, 3]
]; ];
$scope.isUser = function() { $scope.isUser = $scope.$parent.user.id.toString() /*The Actual User*/ === $routeParams.id /*The Profile User*/;
return $scope.$parent.user.id.toString() /*The Actual User*/ === $routeParams.id /*The Profile User*/;
}
} }
]); ]);

View file

@ -17,7 +17,7 @@
<img ng-src="{{user.avatar_url}}" alt="" style="width:20%"> <img ng-src="{{user.avatar_url}}" alt="" style="width:20%">
</div> </div>
<div flex="70%"> <div flex="70%">
<md-button class="md-raised" ng-click="changeProfileMode()" ng-if="isUser()"> <md-button class="md-raised" ng-click="changeProfileMode()" ng-if="isUser">
<i ng-class="profileModeIcon"></i> {{profileMode}} <i ng-class="profileModeIcon"></i> {{profileMode}}
</md-button> </md-button>
</div> </div>
@ -80,7 +80,7 @@
</div> </div>
<div class="spacer"></div> <div class="spacer"></div>
<div> <div>
<md-button class=""> <md-button class="" ng-if="isUser">
X X
</md-button> </md-button>
</div> </div>
@ -102,7 +102,7 @@
</div> </div>
<div class="spacer"></div> <div class="spacer"></div>
<div> <div>
<md-button class=""> <md-button class="" ng-if="isUser">
X X
</md-button> </md-button>
</div> </div>