Add a display alert that shows when the trial period ends (if applicable). Also change the name of the Subscribe buttons to "Start Trial" when no existing subscription is found

This commit is contained in:
Joseph Schorr 2014-04-23 01:10:31 -04:00
parent 189903ffe9
commit a5c2fc7185
3 changed files with 23 additions and 7 deletions

View file

@ -3331,8 +3331,12 @@ quayApp.directive('planManager', function () {
'planChanged': '&planChanged'
},
controller: function($scope, $element, PlanService, ApiService) {
var hasSubscription = false;
$scope.hasSubscription = false;
$scope.parseDate = function(timestamp) {
return new Date(timestamp * 1000);
};
$scope.isPlanVisible = function(plan, subscribedPlan) {
if (plan['deprecated']) {
return plan == subscribedPlan;
@ -3368,10 +3372,7 @@ quayApp.directive('planManager', function () {
var subscribedToPlan = function(sub) {
$scope.subscription = sub;
if (sub.plan != PlanService.getFreePlan()) {
hasSubscription = true;
}
$scope.hasSubscription = true;
PlanService.getPlanIncludingDeprecated(sub.plan, function(subscribedPlan) {
$scope.subscribedPlan = subscribedPlan;