(function() {
/**
* The plans/pricing page.
*/
angular.module('quayPages').config(['pages', function(pages) {
pages.create('plans', 'plans.html', PlansCtrl, {
'title': 'Plans and Pricing',
'newLayout': true
});
}]);
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) {
} else {
$('#signinModal').modal({});
}
// Load the list of plans.
PlanService.getPlans(function(plans) {
$scope.plans = plans;
for (var i = 0; i < $scope.plans.length; ++i) {
var plan = plans[i];
if (plan.privateRepos > 20 && !plan.plans_page_hidden) {
$scope.dropdownPlan = plan.stripeId;
break
if ($scope && $routeParams['trial-plan']) {
$scope.buyNow($routeParams['trial-plan']);
}, /* include the personal plan */ true);
})();