From 08f702a7c50f6f51ee01f2bd45041eb780cde0d6 Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 1 Jul 2014 14:16:41 +0100 Subject: [PATCH] Get free trial button working in share modal --- services/web/app/views/project/editor/share.jade | 5 ++++- .../share/controllers/ShareProjectModalController.coffee | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/services/web/app/views/project/editor/share.jade b/services/web/app/views/project/editor/share.jade index 4efdb72cc4..735cc2ac0e 100644 --- a/services/web/app/views/project/editor/share.jade +++ b/services/web/app/views/project/editor/share.jade @@ -50,7 +50,10 @@ script(type='text/ng-template', id='shareProjectModalTemplate') ) Share div.text-center(ng-hide="canAddCollaborators") p You need to upgrade your account to add more collaborators. - a.btn.btn-info(href) Start Free Trial + p + a.btn.btn-info(href, ng-click="startFreeTrial()") Start Free Trial + p.small(ng-show="state.startedFreeTrial") + | Please refresh this page after starting your free trial. .modal-footer .modal-footer-left diff --git a/services/web/public/coffee/app/ide/share/controllers/ShareProjectModalController.coffee b/services/web/public/coffee/app/ide/share/controllers/ShareProjectModalController.coffee index de849e4d8a..35ca3aa178 100644 --- a/services/web/public/coffee/app/ide/share/controllers/ShareProjectModalController.coffee +++ b/services/web/public/coffee/app/ide/share/controllers/ShareProjectModalController.coffee @@ -9,6 +9,7 @@ define [ $scope.state = { error: null inflight: false + startedFreeTrial: false } $modalInstance.opened.then () -> @@ -52,6 +53,11 @@ 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.done = () -> $modalInstance.close() ] \ No newline at end of file