mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Move the planCode logic for Collaborator into a helper function.
This commit is contained in:
parent
4623f3cbe7
commit
a63f7685b8
2 changed files with 16 additions and 2 deletions
|
@ -100,8 +100,7 @@ block content
|
|||
li
|
||||
br
|
||||
a.btn.btn-info(
|
||||
|
||||
ng-href="#{baseUrl}/user/subscription/new?planCode=collaborator{{ (ui.view == 'annual' ? '-annual' : '') + (plansVariant == 'default' ? planQueryString : '_'+plansVariant)}}¤cy={{currencyCode}}", ng-click="signUpNowClicked('collaborator')"
|
||||
ng-href="#{baseUrl}/user/subscription/new?planCode={{ getCollaboratorPlanCode() }}¤cy={{currencyCode}}", ng-click="signUpNowClicked('collaborator')"
|
||||
)
|
||||
span(ng-show="ui.view != 'annual'") #{translate("start_free_trial")}
|
||||
span(ng-show="ui.view == 'annual'") #{translate("buy_now")}
|
||||
|
|
|
@ -338,6 +338,21 @@ define [
|
|||
$scope.changeCurreny = (newCurrency)->
|
||||
$scope.currencyCode = newCurrency
|
||||
|
||||
# because ternary logic in angular bindings is hard
|
||||
$scope.getCollaboratorPlanCode = () ->
|
||||
view = $scope.ui.view
|
||||
variant = $scope.plansVariant
|
||||
if view == "annual"
|
||||
if variant == "default"
|
||||
return "collaborator-annual"
|
||||
else
|
||||
return "collaborator-annual_#{variant}"
|
||||
else
|
||||
if variant == "default"
|
||||
return "collaborator#{$scope.planQueryString}"
|
||||
else
|
||||
return "collaborator_#{variant}"
|
||||
|
||||
$scope.signUpNowClicked = (plan, annual)->
|
||||
event_tracking.sendMB 'plans-page-start-trial', {plan}
|
||||
if $scope.ui.view == "annual"
|
||||
|
|
Loading…
Reference in a new issue