Show a loading spinner while we're waiting for subscription information.

This commit is contained in:
yackob03 2013-10-02 01:03:48 -04:00
parent 755fc168af
commit c7e83c4d41
3 changed files with 11 additions and 1 deletions

View file

@ -445,10 +445,16 @@ function UserAdminCtrl($scope, Restangular) {
planDict[$scope.plans[i].stripeId] = $scope.plans[i];
}
$('.spin').spin();
$scope.loading = true;
var getSubscription = Restangular.one('user/plan');
getSubscription.get().then(function(sub) {
// User has a subscription
$scope.subscription = sub;
$scope.loading = false;
}, function() {
$scope.loading = false;
});
$scope.subscribe = function(planId) {

View file

@ -1,5 +1,5 @@
<div class="container">
<div class="row">
<div class="row" ng-hide="loading">
<div class="col-md-4" ng-repeat='plan in plans'>
<div class="panel" ng-class="{'panel-success': subscription.plan == plan.stripeId, 'panel-default': subscription.plan != plan.stripeId}">
<div class="panel-heading">
@ -18,4 +18,7 @@
</div>
</div>
</div>
<div class="loading" ng-show="loading">
<div class="spin"></div>
</div>
</div>

View file

@ -70,6 +70,7 @@
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="#/user">User Settings</a></li>
<li><a href="/signout">Sign out</a></li>
</ul>
</li>