new-refreshed.pug 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. extends ../layout
  2. block vars
  3. - var suppressNavbarRight = true
  4. - var suppressFooter = true
  5. block append meta
  6. meta(name="ol-countryCode" content=countryCode)
  7. meta(name="ol-recurlyApiKey" content=settings.apis.recurly.publicKey)
  8. meta(name="ol-recommendedCurrency" content=String(currency).slice(0,3))
  9. block head-scripts
  10. script(type="text/javascript", nonce=scriptNonce, src="https://js.recurly.com/v4/recurly.js")
  11. block content
  12. main.content.content-alt#main-content
  13. .container(ng-controller="NewSubscriptionController" ng-cloak)
  14. .row.card-group
  15. .col-md-3.col-md-push-1
  16. .card.card-highlighted
  17. .price-feature-description
  18. h4(ng-if="planName") {{planName}}
  19. h4(ng-if="!planName") #{plan.name}
  20. if plan.features
  21. if plan.features.collaborators === 1
  22. .text-small.number-of-collaborators #{translate("collabs_per_proj_single", {collabcount: 1})}
  23. if plan.features.collaborators === -1
  24. .text-small.number-of-collaborators #{translate("unlimited_collabs")}
  25. if plan.features.collaborators > 1
  26. .text-small.number-of-collaborators #{translate("collabs_per_proj", {collabcount: plan.features.collaborators})}
  27. .text-small #{translate("all_premium_features_including")}
  28. ul.small
  29. if plan.features.compileTimeout > 1
  30. li #{translate("increased_compile_timeout")}
  31. if plan.features.dropbox && plan.features.github
  32. li #{translate("sync_dropbox_github")}
  33. if plan.features.versioning
  34. li #{translate("full_doc_history")}
  35. if plan.features.trackChanges
  36. li #{translate("track_changes")}
  37. if plan.features.references
  38. li #{translate("reference_search")}
  39. if plan.features.mendeley || plan.features.zotero
  40. li #{translate("reference_sync")}
  41. if plan.features.symbolyPalette
  42. li #{translate("symboly_palette")}
  43. div.price-summary(ng-if="recurlyPrice")
  44. - var priceVars = { price: "{{ availableCurrencies[currencyCode]['symbol'] }}{{ recurlyPrice.total }}"};
  45. hr
  46. h4 #{translate("payment_summary")}
  47. div.small
  48. .price-summary-line
  49. span
  50. | {{planName}}
  51. span(ng-if="coupon")
  52. | {{ availableCurrencies[currencyCode]['symbol'] }}{{ coupon.normalPriceWithoutTax | number:2 }}
  53. span(ng-if="!coupon")
  54. | {{ availableCurrencies[currencyCode]['symbol'] }}{{ recurlyPrice.subtotal }}
  55. .price-summary-line(ng-if="coupon")
  56. span
  57. | {{ coupon.name }}
  58. span
  59. | –{{ availableCurrencies[currencyCode]['symbol'] }}{{ recurlyPrice.discount}}
  60. .price-summary-line(ng-if="taxes && taxes[0] && taxes[0].rate > 0")
  61. span
  62. | #{translate("vat")} {{taxes[0].rate * 100}}%
  63. span
  64. | {{ availableCurrencies[currencyCode]['symbol'] }}{{ recurlyPrice.tax }}
  65. .price-summary-line.price-summary-total-line
  66. span
  67. b {{ monthlyBilling ? '#{translate("total_per_month")}' : '#{translate("total_per_year")}'}}
  68. span
  69. b {{ availableCurrencies[currencyCode]['symbol'] }}{{ recurlyPrice.total }}
  70. .change-currency
  71. div.dropdown(ng-cloak dropdown)
  72. button.btn.btn-link.dropdown-toggle.change-currency-toggle(
  73. href="#",
  74. data-toggle="dropdown",
  75. dropdown-toggle
  76. ) Change currency
  77. ul.dropdown-menu(role="menu")
  78. li(ng-repeat="(currency, value) in limitedCurrencies")
  79. a(
  80. ng-click="changeCurrency(currency)",
  81. )
  82. span.change-currency-dropdown-selected-icon(ng-show="currency == currencyCode")
  83. i.fa.fa-check
  84. | {{currency}} ({{value['symbol']}})
  85. hr.thin(ng-if="trialLength || coupon")
  86. div.trial-coupon-summary
  87. div(ng-if="trialLength")
  88. - var trialPriceVars = { price: "{{ availableCurrencies[currencyCode]['symbol'] }}{{ recurlyPrice.total }}", trialLen:'{{trialLength}}' };
  89. | !{translate("first_x_days_free_after_that_y_per_month", trialPriceVars, ['strong'] )}
  90. div(ng-if="recurlyPrice")
  91. - var priceVars = { price: "{{ availableCurrencies[currencyCode]['symbol'] }}{{ recurlyPrice.total }}", discountMonths: "{{ coupon.discountMonths }}" };
  92. span(ng-if="!coupon.singleUse && coupon.discountMonths > 0 && monthlyBilling")
  93. | !{translate("x_price_for_y_months", priceVars, ['strong'] )}
  94. span(ng-if="coupon.singleUse && monthlyBilling")
  95. | !{translate("x_price_for_first_month", priceVars, ['strong'] )}
  96. span(ng-if="coupon.singleUse && !monthlyBilling")
  97. | !{translate("x_price_for_first_year", priceVars, ['strong'] )}
  98. div(ng-if="coupon && coupon.normalPrice")
  99. - var noDiscountPriceAngularExp = "{{ availableCurrencies[currencyCode]['symbol']}}{{coupon.normalPrice | number:2 }}";
  100. span(ng-if="!coupon.singleUse && coupon.discountMonths > 0 && monthlyBilling")
  101. | !{translate("then_x_price_per_month", { price: noDiscountPriceAngularExp } )}
  102. span(ng-if="!coupon.singleUse && !coupon.discountMonths && monthlyBilling")
  103. | !{translate("normally_x_price_per_month", { price: noDiscountPriceAngularExp } )}
  104. span(ng-if="!coupon.singleUse && !monthlyBilling")
  105. | !{translate("normally_x_price_per_year", { price: noDiscountPriceAngularExp } )}
  106. span(ng-if="coupon.singleUse && monthlyBilling")
  107. | !{translate("then_x_price_per_month", { price: noDiscountPriceAngularExp } )}
  108. span(ng-if="coupon.singleUse && !monthlyBilling")
  109. | !{translate("then_x_price_per_year", { price: noDiscountPriceAngularExp } )}
  110. hr.thin
  111. p.price-cancel-anytime.text-center(ng-non-bindable) !{translate("cancel_anytime", { appName:'{{settings.appName}}' })}
  112. .col-md-5.col-md-push-1
  113. .card.card-highlighted.card-border(ng-hide="threeDSecureFlow")
  114. .alert.alert-danger(ng-show="recurlyLoadError")
  115. strong #{translate('payment_provider_unreachable_error')}
  116. .price-switch-header(ng-hide="recurlyLoadError")
  117. .row
  118. .col-xs-9
  119. h2 #{translate('select_a_payment_method')}
  120. .row(ng-if="planCode == 'student-annual' || planCode == 'student-monthly' || planCode == 'student_free_trial_7_days'")
  121. .col-xs-12
  122. p.student-disclaimer #{translate('student_disclaimer')}
  123. .row(ng-hide="recurlyLoadError")
  124. div()
  125. .col-md-12()
  126. form(
  127. name="simpleCCForm"
  128. novalidate
  129. )
  130. .alert.alert-warning.small(ng-show="genericError")
  131. strong {{genericError}}
  132. .alert.alert-warning.small(ng-show="couponError")
  133. strong {{couponError}}
  134. div
  135. .form-group.payment-method-toggle
  136. hr.thin
  137. .radio
  138. .col-xs-8
  139. label
  140. input(
  141. type="radio"
  142. ng-model="paymentMethod.value"
  143. name="payment_method"
  144. checked=true
  145. value="credit_card"
  146. )
  147. strong
  148. | #{translate("card_payment")}
  149. span.hidden-xs
  150. |  
  151. i.fa.fa-cc-visa(aria-hidden="true")
  152. |  
  153. i.fa.fa-cc-mastercard(aria-hidden="true")
  154. |  
  155. i.fa.fa-cc-amex(aria-hidden="true")
  156. .col-xs-4
  157. label
  158. input(
  159. type="radio"
  160. ng-model="paymentMethod.value"
  161. name="payment_method"
  162. checked=false
  163. value="paypal"
  164. )
  165. strong PayPal
  166. span.hidden-xs
  167. |  
  168. i.fa.fa-cc-paypal(aria-hidden="true")
  169. div(ng-show="paymentMethod.value === 'credit_card'")
  170. .form-group(ng-class="showCardElementInvalid ? 'has-error' : ''")
  171. label(for="recurly-card-input") #{translate("card_details")}
  172. div#recurly-card-input
  173. span.input-feedback-message(ng-if="showCardElementInvalid") Card details are not valid
  174. .row
  175. .col-xs-6
  176. .form-group(ng-class="validation.errorFields.first_name || inputHasError(simpleCCForm.firstName) ? 'has-error' : ''")
  177. label(for="first-name") #{translate('first_name')}
  178. input#first-name.form-control(
  179. type="text"
  180. maxlength='255'
  181. data-recurly="first_name"
  182. name="firstName"
  183. ng-model="data.first_name"
  184. required
  185. )
  186. span.input-feedback-message(ng-if="simpleCCForm.firstName.$error.required") #{translate('this_field_is_required')}
  187. .col-xs-6
  188. .form-group(ng-class="validation.errorFields.last_name || inputHasError(simpleCCForm.lastName)? 'has-error' : ''")
  189. label(for="last-name") #{translate('last_name')}
  190. input#last-name.form-control(
  191. type="text"
  192. maxlength='255'
  193. data-recurly="last_name"
  194. name="lastName"
  195. ng-model="data.last_name"
  196. required
  197. )
  198. span.input-feedback-message(ng-if="simpleCCForm.lastName.$error.required") #{translate('this_field_is_required')}
  199. div
  200. .row
  201. .col-xs-12
  202. .form-group(ng-class="validation.errorFields.address1 || inputHasError(simpleCCForm.address1) ? 'has-error' : ''")
  203. label(for="address-line-1") #{translate('address_line_1')}  
  204. i.fa.fa-question-circle(
  205. aria-label=translate('this_address_will_be_shown_on_the_invoice'),
  206. tooltip=translate('this_address_will_be_shown_on_the_invoice'),
  207. tooltip-placement="right",
  208. tooltip-append-to-body="true",
  209. )
  210. input#address-line-1.form-control(
  211. type="text"
  212. maxlength="255"
  213. data-recurly="address1"
  214. name="address1"
  215. ng-model="data.address1"
  216. required
  217. )
  218. span.input-feedback-message(ng-if="simpleCCForm.address1.$error.required") #{translate('this_field_is_required')}
  219. .row.toggle-address-second-line(ng-hide="ui.showAddressSecondLine")
  220. .col-xs-12
  221. a.text-small(
  222. href="#"
  223. ng-click="showAddressSecondLine($event)"
  224. ) + Add another address line
  225. .row(ng-show="ui.showAddressSecondLine")
  226. .col-xs-12
  227. .form-group.has-feedback(ng-class="validation.errorFields.address2 ? 'has-error' : ''")
  228. label(for="address-line-2") #{translate('address_second_line_optional')}
  229. input#address-line-2.form-control(
  230. type="text"
  231. maxlength="255"
  232. data-recurly="address2"
  233. name="address2"
  234. ng-model="data.address2"
  235. )
  236. .row
  237. .col-xs-4
  238. .form-group(ng-class="validation.errorFields.postal_code || inputHasError(simpleCCForm.postalCode) ? 'has-error' : ''")
  239. label(for="postal-code") #{translate('postal_code')}
  240. input#postal-code.form-control(
  241. type="text"
  242. maxlength="255"
  243. data-recurly="postal_code"
  244. name="postalCode"
  245. ng-model="data.postal_code"
  246. required
  247. )
  248. span.input-feedback-message(ng-if="simpleCCForm.postalCode.$error.required") #{translate('this_field_is_required')}
  249. .col-xs-8
  250. .form-group(ng-class="validation.errorFields.country || inputHasError(simpleCCForm.country) ? 'has-error' : ''")
  251. label(for="country") #{translate('country')}
  252. select#country.form-control(
  253. data-recurly="country"
  254. ng-model="data.country"
  255. name="country"
  256. ng-change="updateCountry()"
  257. ng-selected="{{country.code == data.country}}"
  258. ng-model-options="{ debounce: 200 }"
  259. required
  260. )
  261. option(value='', disabled) #{translate("country")}
  262. option(value='-', disabled) --------------
  263. option(ng-repeat="country in countries" ng-bind-html="country.name" value="{{country.code}}")
  264. span.input-feedback-message(ng-if="simpleCCForm.country.$error.required") #{translate('this_field_is_required')}
  265. .form-group
  266. .checkbox
  267. label
  268. input(
  269. type="checkbox"
  270. ng-model="ui.addCompanyDetails"
  271. )
  272. |
  273. | #{translate("add_company_details")}
  274. .form-group(ng-show="ui.addCompanyDetails")
  275. label(for="company-name") #{translate("company_name")}
  276. input#company-name.form-control(
  277. type="text"
  278. name="companyName"
  279. ng-model="data.company"
  280. )
  281. .form-group(ng-show="ui.addCompanyDetails && taxes.length")
  282. label(for="vat-number") #{translate("vat_number")}
  283. input#vat-number.form-control(
  284. type="text"
  285. name="vatNumber"
  286. ng-model="data.vat_number"
  287. ng-blur="applyVatNumber()"
  288. )
  289. if (showCouponField)
  290. .form-group
  291. label(for="coupon-code") #{translate('coupon_code')}
  292. input#coupon-code.form-control(
  293. type="text"
  294. ng-blur="applyCoupon()"
  295. ng-model="data.coupon"
  296. )
  297. p(ng-if="paymentMethod.value === 'paypal'") #{translate("proceeding_to_paypal_takes_you_to_the_paypal_site_to_pay")}
  298. hr.thin
  299. div.payment-submit
  300. button.btn.btn-success.btn-block(
  301. ng-click="submit()"
  302. ng-disabled="processing || !isFormValid(simpleCCForm);"
  303. )
  304. span(ng-show="processing")
  305. i.fa.fa-spinner.fa-spin(aria-hidden="true")
  306. span.sr-only #{translate('processing')}
  307. |  
  308. span(ng-if="paymentMethod.value === 'credit_card'")
  309. | {{ trialLength ? '#{translate("upgrade_cc_btn")}' : '#{translate("upgrade_now")}'}}
  310. span(ng-if="paymentMethod.value !== 'credit_card'") #{translate("proceed_to_paypal")}
  311. p.tos-agreement-notice !{translate("by_subscribing_you_agree_to_our_terms_of_service", {}, [{name: 'a', attrs: {href: '/legal#Terms', target:'_blank', rel:'noopener noreferrer'}}])}
  312. div.three-d-secure-container.card.card-highlighted.card-border(ng-show="threeDSecureFlow")
  313. .alert.alert-info.small(aria-live="assertive")
  314. strong #{translate('card_must_be_authenticated_by_3dsecure')}
  315. div.three-d-secure-recurly-container
  316. script(type="text/javascript", nonce=scriptNonce).
  317. ga('send', 'event', 'pageview', 'payment_form', "#{plan_code}")
  318. script(
  319. type="text/ng-template"
  320. id="cvv-tooltip-tpl.html"
  321. )
  322. p !{translate("for_visa_mastercard_and_discover", {}, ['strong', 'strong', 'strong'])}
  323. p !{translate("for_american_express", {}, ['strong', 'strong', 'strong'])}