plans.coffee 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. define [
  2. "base"
  3. "libs/recurly-3.0.5"
  4. ], (App, recurly) ->
  5. App.factory "MultiCurrencyPricing", () ->
  6. currencyCode = window.recomendedCurrency
  7. return {
  8. currencyCode:currencyCode
  9. plans:
  10. USD:
  11. symbol: "$"
  12. student:
  13. monthly: "$8"
  14. annual: "$80"
  15. collaborator:
  16. monthly: "$15"
  17. annual: "$180"
  18. professional:
  19. monthly: "$30"
  20. annual: "$360"
  21. EUR:
  22. symbol: "€"
  23. student:
  24. monthly: "€7"
  25. annual: "€70"
  26. collaborator:
  27. monthly: "€14"
  28. annual: "€168"
  29. professional:
  30. monthly: "€28"
  31. annual: "€336"
  32. GBP:
  33. symbol: "£"
  34. student:
  35. monthly: "£6"
  36. annual: "£60"
  37. collaborator:
  38. monthly: "£12"
  39. annual: "£144"
  40. professional:
  41. monthly: "£24"
  42. annual: "£288"
  43. SEK:
  44. symbol: "kr"
  45. student:
  46. monthly: "60 kr"
  47. annual: "600 kr"
  48. collaborator:
  49. monthly: "110 kr"
  50. annual: "1320 kr"
  51. professional:
  52. monthly: "220 kr"
  53. annual: "2640 kr"
  54. CAD:
  55. symbol: "$"
  56. student:
  57. monthly: "$9"
  58. annual: "$90"
  59. collaborator:
  60. monthly: "$17"
  61. annual: "$204"
  62. professional:
  63. monthly: "$34"
  64. annual: "$408"
  65. NOK:
  66. symbol: "kr"
  67. student:
  68. monthly: "60 kr"
  69. annual: "600 kr"
  70. collaborator:
  71. monthly: "110 kr"
  72. annual: "1320 kr"
  73. professional:
  74. monthly: "220 kr"
  75. annual: "2640 kr"
  76. DKK:
  77. symbol: "kr"
  78. student:
  79. monthly: "50 kr"
  80. annual: "500 kr"
  81. collaborator:
  82. monthly: "90 kr"
  83. annual: "1080 kr"
  84. professional:
  85. monthly: "180 kr"
  86. annual: "2160 kr"
  87. AUD:
  88. symbol: "$"
  89. student:
  90. monthly: "$10"
  91. annual: "$100"
  92. collaborator:
  93. monthly: "$18"
  94. annual: "$216"
  95. professional:
  96. monthly: "$35"
  97. annual: "$420"
  98. NZD:
  99. symbol: "$"
  100. student:
  101. monthly: "$10"
  102. annual: "$100"
  103. collaborator:
  104. monthly: "$18"
  105. annual: "$216"
  106. professional:
  107. monthly: "$35"
  108. annual: "$420"
  109. CHF:
  110. symbol: "Fr"
  111. student:
  112. monthly: "Fr 8"
  113. annual: "Fr 80"
  114. collaborator:
  115. monthly: "Fr 15"
  116. annual: "Fr 180"
  117. professional:
  118. monthly: "Fr 30"
  119. annual: "Fr 360"
  120. SGD:
  121. symbol: "$"
  122. student:
  123. monthly: "$12"
  124. annual: "$120"
  125. collaborator:
  126. monthly: "$20"
  127. annual: "$240"
  128. professional:
  129. monthly: "$40"
  130. annual: "$480"
  131. }
  132. App.controller "PlansController", ($scope, $modal, event_tracking, abTestManager, MultiCurrencyPricing, $http) ->
  133. $scope.plans = MultiCurrencyPricing.plans
  134. $scope.currencyCode = MultiCurrencyPricing.currencyCode
  135. $scope.trial_len = 7
  136. $scope.planQueryString = '_free_trial_7_days'
  137. $scope.ui =
  138. view: "monthly"
  139. $scope.changeCurreny = (newCurrency)->
  140. $scope.currencyCode = newCurrency
  141. $scope.signUpNowClicked = (plan, annual)->
  142. if $scope.ui.view == "annual"
  143. plan = "#{plan}_annual"
  144. event_tracking.send 'subscription-funnel', 'sign_up_now_button', plan
  145. $scope.switchToMonthly = ->
  146. $scope.ui.view = "monthly"
  147. event_tracking.send 'subscription-funnel', 'plans-page', 'monthly-prices'
  148. $scope.switchToStudent = ->
  149. $scope.ui.view = "student"
  150. event_tracking.send 'subscription-funnel', 'plans-page', 'student-prices'
  151. $scope.switchToAnnual = ->
  152. $scope.ui.view = "annual"
  153. event_tracking.send 'subscription-funnel', 'plans-page', 'student-prices'
  154. $scope.openGroupPlanModal = () ->
  155. $modal.open {
  156. templateUrl: "groupPlanModalTemplate"
  157. }