From ee7013c1eedc0a957d8ba8666316c06c6bd912a8 Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 17 Jul 2014 12:57:17 +0100 Subject: [PATCH] TRack free trial clicks and redirect to subscription page --- services/web/app/views/project/editor/share.jade | 4 ++-- services/web/app/views/project/editor/track-changes.jade | 5 ++--- services/web/public/coffee/ide.coffee | 7 +++++++ .../share/controllers/ShareProjectModalController.coffee | 5 ----- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/services/web/app/views/project/editor/share.jade b/services/web/app/views/project/editor/share.jade index de1968b35e..2262484c60 100644 --- a/services/web/app/views/project/editor/share.jade +++ b/services/web/app/views/project/editor/share.jade @@ -69,8 +69,8 @@ script(type='text/ng-template', id='shareProjectModalTemplate') div.text-center(ng-hide="canAddCollaborators") p You need to upgrade your account to add more collaborators. p - a.btn.btn-info(href, ng-click="startFreeTrial()") Start Free Trial - p.small(ng-show="state.startedFreeTrial") + a.btn.btn-info(href, ng-click="startFreeTrial('projectMembers')") Start Free Trial + p.small(ng-show="startedFreeTrial") | Please refresh this page after starting your free trial. .modal-footer diff --git a/services/web/app/views/project/editor/track-changes.jade b/services/web/app/views/project/editor/track-changes.jade index 40b16231e9..6b440906db 100644 --- a/services/web/app/views/project/editor/track-changes.jade +++ b/services/web/app/views/project/editor/track-changes.jade @@ -4,9 +4,8 @@ div#trackChanges(ng-show="ui.view == 'track-changes'") p You need to upgrade your account to use the History feature. p a.btn.btn-info( - href="/user/subscription/plans" - target="_blank" - ng-click="startedFreeTrial = true" + href + ng-click="startFreeTrial('track-changes')" ) Start Free Trial p.small(ng-show="startedFreeTrial") Please refresh the page after starting your free trial. .message(ng-show="project.owner._id != user.id") diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index 9ec93d9890..55c2825b26 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -53,6 +53,13 @@ define [ $scope.settings = window.userSettings $scope.chat = {} + + $scope.startFreeTrial = + + $scope.startFreeTrial = (source) -> + ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source) + window.open("/user/subscription/new?planCode=student_free_trial") + $scope.startedFreeTrial = true window._ide = ide diff --git a/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee b/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee index b0343dff8f..cc2236f0bf 100644 --- a/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee +++ b/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee @@ -51,11 +51,6 @@ define [ $scope.state.inflight = false $scope.state.error = "Sorry, something went wrong :(" - $scope.startFreeTrial = () -> - ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', "projectMembers") - window.open("/user/subscription/plans") - $scope.state.startedFreeTrial = true - $scope.openMakePublicModal = () -> $modal.open { templateUrl: "makePublicModalTemplate"