This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/js/pages/plans.js
2015-02-23 14:23:54 -05:00

38 lines
No EOL
1 KiB
JavaScript

(function() {
/**
* The plans/pricing page.
*/
angular.module('quayPages').config(['pages', function(pages) {
pages.create('plans', 'plans.html', PlansCtrl, {
'title': 'Plans and Pricing'
});
}]);
function PlansCtrl($scope, $location, UserService, PlanService, $routeParams) {
// Monitor any user changes and place the current user into the scope.
UserService.updateUserIn($scope);
$scope.signedIn = function() {
$('#signinModal').modal('hide');
PlanService.handleNotedPlan();
};
$scope.buyNow = function(plan) {
PlanService.notePlan(plan);
if ($scope.user && !$scope.user.anonymous) {
PlanService.handleNotedPlan();
} else {
$('#signinModal').modal({});
}
};
// Load the list of plans.
PlanService.getPlans(function(plans) {
$scope.plans = plans;
if ($scope && $routeParams['trial-plan']) {
$scope.buyNow($routeParams['trial-plan']);
}
}, /* include the personal plan */ true);
}
})();