new.pug 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. extends ../layout
  2. block scripts
  3. script(src="https://js.recurly.com/v3/recurly.js")
  4. script(type='text/javascript').
  5. window.countryCode = '#{countryCode}'
  6. window.plan_code = '#{plan_code}'
  7. window.recurlyApiKey = "!{settings.apis.recurly.publicKey}"
  8. window.couponCode = !{JSON.stringify(couponCode)}
  9. window.recomendedCurrency = !{JSON.stringify(currency.slice(0,3))}
  10. block content
  11. .content.content-alt
  12. .container(ng-controller="NewSubscriptionController" ng-cloak)
  13. .row.card-group
  14. .col-md-5.col-md-push-4
  15. .card.card-highlighted
  16. .page-header
  17. .row
  18. .col-xs-9
  19. h2 {{planName}}
  20. .col-xs-3
  21. div.dropdown.changePlanButton.pull-right(ng-cloak, dropdown)
  22. a.btn.btn-default.dropdown-toggle(
  23. href="#",
  24. data-toggle="dropdown",
  25. dropdown-toggle
  26. )
  27. | {{currencyCode}} ({{plans[currencyCode]['symbol']}})
  28. span.caret
  29. ul.dropdown-menu(role="menu")
  30. li(ng-repeat="(currency, value) in plans")
  31. a(
  32. ng-click="changeCurrency(currency)",
  33. ) {{currency}} ({{value['symbol']}})
  34. hr.thin
  35. .row
  36. .col-md-12.text-center
  37. div(ng-if="trialLength")
  38. span !{translate("first_few_days_free", {trialLen:'{{trialLength}}'})}
  39. span(ng-if="discountMonths && discountRate")   - {{discountMonths}} #{translate("month")}s {{discountRate}}% Off
  40. div(ng-if="price")
  41. strong {{price.currency.symbol}}{{price.next.total}}
  42. span(ng-if="monthlyBilling") #{translate("every")} #{translate("month")}
  43. span(ng-if="!monthlyBilling") #{translate("every")} #{translate("year")}
  44. div(ng-if="normalPrice")
  45. span.small Normally {{price.currency.symbol}}{{normalPrice}}
  46. .row
  47. div()
  48. .col-md-12()
  49. form(
  50. ng-if="planName"
  51. name="simpleCCForm"
  52. novalidate
  53. )
  54. div.payment-method-toggle
  55. a.payment-method-toggle-switch(
  56. href
  57. ng-click="setPaymentMethod('credit_card');"
  58. ng-class="paymentMethod.value === 'credit_card' ? 'payment-method-toggle-switch-selected' : ''"
  59. )
  60. i.fa.fa-cc-mastercard.fa-2x
  61. span  
  62. i.fa.fa-cc-visa.fa-2x
  63. span  
  64. i.fa.fa-cc-amex.fa-2x
  65. a.payment-method-toggle-switch(
  66. href
  67. ng-click="setPaymentMethod('paypal');"
  68. ng-class="paymentMethod.value === 'paypal' ? 'payment-method-toggle-switch-selected' : ''"
  69. )
  70. i.fa.fa-cc-paypal.fa-2x
  71. .alert.alert-warning.small(ng-show="genericError")
  72. strong {{genericError}}
  73. div(ng-if="paymentMethod.value === 'credit_card'")
  74. .row
  75. .col-xs-6
  76. .form-group(ng-class="validation.errorFields.first_name || inputHasError(simpleCCForm.firstName) ? 'has-error' : ''")
  77. label(for="first-name") #{translate('first_name')}
  78. input#first-name.form-control(
  79. type="text"
  80. maxlength='255'
  81. data-recurly="first_name"
  82. name="firstName"
  83. ng-model="data.first_name"
  84. required
  85. )
  86. span.input-feedback-message {{ simpleCCForm.firstName.$error.required ? 'This field is required' : '' }}
  87. .col-xs-6
  88. .form-group(for="last-name",ng-class="validation.errorFields.last_name || inputHasError(simpleCCForm.lastName)? 'has-error' : ''")
  89. label(for="last-name") #{translate('last_name')}
  90. input#last-name.form-control(
  91. type="text"
  92. maxlength='255'
  93. data-recurly="last_name"
  94. name="lastName"
  95. ng-model="data.last_name"
  96. required
  97. )
  98. span.input-feedback-message {{ simpleCCForm.lastName.$error.required ? 'This field is required' : '' }}
  99. .form-group(ng-class="validation.correctCardNumber == false || validation.errorFields.number || inputHasError(simpleCCForm.ccNumber) ? 'has-error' : ''")
  100. label(for="card-no") #{translate("credit_card_number")}
  101. input#card-no.form-control(
  102. type="text"
  103. ng-model="data.number"
  104. name="ccNumber"
  105. ng-focus="validation.correctCardNumber = true; validation.errorFields.number = false;"
  106. ng-blur="validateCardNumber();"
  107. required
  108. cc-format-card-number
  109. )
  110. span.input-feedback-message {{ simpleCCForm.ccNumber.$error.required ? 'This field is required' : 'Please re-check the card number' }}
  111. .row
  112. .col-xs-6
  113. .form-group.has-feedback(ng-class="validation.correctExpiry == false || validation.errorFields.expiry || inputHasError(simpleCCForm.expiry) ? 'has-error' : ''")
  114. label #{translate("expiry")}
  115. input.form-control(
  116. type="text"
  117. ng-model="data.mmYY"
  118. name="expiry"
  119. placeholder="MM / YY"
  120. ng-focus="validation.correctExpiry = true; validation.errorFields.expiry = false;"
  121. ng-blur="updateExpiry(); validateExpiry()"
  122. required
  123. cc-format-expiry
  124. )
  125. span.input-feedback-message {{ simpleCCForm.expiry.$error.required ? 'This field is required' : 'Please re-check the expiry date' }}
  126. .col-xs-6
  127. .form-group.has-feedback(ng-class="validation.correctCvv == false || validation.errorFields.cvv || inputHasError(simpleCCForm.cvv) ? 'has-error' : ''")
  128. label #{translate("security_code")}
  129. input.form-control(
  130. type="text"
  131. ng-model="data.cvv"
  132. ng-focus="validation.correctCvv = true; validation.errorFields.cvv = false;"
  133. ng-blur="validateCvv()"
  134. name="cvv"
  135. required
  136. cc-format-sec-code
  137. )
  138. .form-control-feedback
  139. a.form-helper(
  140. href
  141. tabindex="-1"
  142. tooltip-template="'cvv-tooltip-tpl.html'"
  143. tooltip-trigger="mouseenter"
  144. tooltip-append-to-body="true"
  145. ) ?
  146. span.input-feedback-message {{ simpleCCForm.cvv.$error.required ? 'This field is required' : 'Please re-check the security code' }}
  147. div
  148. .form-group(ng-class="validation.errorFields.country || inputHasError(simpleCCForm.country) ? 'has-error' : ''")
  149. label(for="country") #{translate('country')}
  150. select#country.form-control(
  151. data-recurly="country"
  152. ng-model="data.country"
  153. name="country"
  154. ng-change="updateCountry()"
  155. required
  156. )
  157. +countries_options()
  158. span.input-feedback-message {{ simpleCCForm.country.$error.required ? 'This field is required' : '' }}
  159. if (showVatField)
  160. .form-group
  161. label(for="vat-no") #{translate('vat_number')}
  162. input#vat-no.form-control(
  163. type="text"
  164. ng-blur="applyVatNumber()"
  165. ng-model="data.vat_number"
  166. )
  167. if (showCouponField)
  168. .form-group
  169. label(for="coupon-code") #{translate('coupon_code')}
  170. input#coupon-code.form-control(
  171. type="text"
  172. ng-blur="applyCoupon()"
  173. ng-model="data.coupon"
  174. )
  175. p(ng-if="paymentMethod.value === 'paypal'") #{translate("paypal_upgrade")}
  176. div.price-breakdown(ng-if="price.next.tax !== '0.00'")
  177. hr.thin
  178. span Total:
  179. strong {{price.currency.symbol}}{{price.next.total}}
  180. span ({{price.currency.symbol}}{{price.next.subtotal}} + {{price.currency.symbol}}{{price.next.tax}} tax)
  181. span(ng-if="monthlyBilling") #{translate("every")} #{translate("month")}
  182. span(ng-if="!monthlyBilling") #{translate("every")} #{translate("year")}
  183. hr.thin
  184. div.payment-submit
  185. button.btn.btn-success.btn-block(
  186. ng-click="submit()"
  187. ng-disabled="processing || !isFormValid(simpleCCForm);"
  188. )
  189. span(ng-show="processing")
  190. i.fa.fa-spinner.fa-spin
  191. |  
  192. | {{ paymentMethod.value === 'credit_card' ? '#{translate("upgrade_cc_btn")}' : '#{translate("upgrade_paypal_btn")}' }}
  193. .col-md-3.col-md-pull-4
  194. if showStudentPlan == 'true'
  195. a.btn-primary.btn.plansPageStudentLink(
  196. href,
  197. ng-click="switchToStudent()"
  198. ) #{translate("half_price_student")}
  199. .card.card-first
  200. .paymentPageFeatures
  201. h3 #{translate("unlimited_projects")}
  202. p #{translate("create_unlimited_projects")}
  203. h3
  204. if plan.features.collaborators == -1
  205. - var collaboratorCount = 'Unlimited'
  206. else
  207. - var collaboratorCount = plan.features.collaborators
  208. | #{translate("collabs_per_proj", {collabcount:collaboratorCount})}
  209. p #{translate("work_on_single_version")}. #{translate("view_collab_edits")} in real time.
  210. h3 #{translate("full_doc_history")}
  211. p #{translate("see_what_has_been")}
  212. span.added #{translate("added")}
  213. | #{translate("and")}
  214. span.removed #{translate("removed")}.
  215. | #{translate("restore_to_any_older_version")}.
  216. h3 #{translate("sync_to_dropbox")}
  217. p
  218. | #{translate("acces_work_from_anywhere")}.
  219. | #{translate("work_offline_and_sync_with_dropbox")}.
  220. hr
  221. p.small.text-center We're confident that you'll love ShareLaTeX, but if not you can cancel anytime. We'll give you your money back, no questions asked, if you let us know within 30 days.
  222. hr
  223. span                  
  224. a(href="https://www.positivessl.com" style="font-family: arial; font-size: 10px; color: #212121; text-decoration: none;")
  225. img(src="https://www.positivessl.com/images-new/PositiveSSL_tl_trans.png" alt="SSL Certificate" title="SSL Certificate" border="0")
  226. div(style="font-family: arial;font-weight:bold;font-size:15px;color:#86BEE0;")
  227. a(href="https://www.positivessl.com" style="color:#86BEE0; text-decoration: none;")
  228. script(type="text/javascript").
  229. ga('send', 'event', 'pageview', 'payment_form', "#{plan_code}")
  230. script(
  231. type="text/ng-template"
  232. id="cvv-tooltip-tpl.html"
  233. )
  234. p For #[strong Visa, MasterCard and Discover], the #[strong 3 digits] on the #[strong back] of your card.
  235. p For #[strong American Express], the #[strong 4 digits] on the #[strong front] of your card.
  236. mixin countries_options()
  237. option(value='', disabled, selected) #{translate("country")}
  238. option(value='-') --------------
  239. option(value='AF') Afghanistan
  240. option(value='AL') Albania
  241. option(value='DZ') Algeria
  242. option(value='AS') American Samoa
  243. option(value='AD') Andorra
  244. option(value='AO') Angola
  245. option(value='AI') Anguilla
  246. option(value='AQ') Antarctica
  247. option(value='AG') Antigua and Barbuda
  248. option(value='AR') Argentina
  249. option(value='AM') Armenia
  250. option(value='AW') Aruba
  251. option(value='AC') Ascension Island
  252. option(value='AU') Australia
  253. option(value='AT') Austria
  254. option(value='AZ') Azerbaijan
  255. option(value='BS') Bahamas
  256. option(value='BH') Bahrain
  257. option(value='BD') Bangladesh
  258. option(value='BB') Barbados
  259. option(value='BE') Belgium
  260. option(value='BZ') Belize
  261. option(value='BJ') Benin
  262. option(value='BM') Bermuda
  263. option(value='BT') Bhutan
  264. option(value='BO') Bolivia
  265. option(value='BA') Bosnia and Herzegovina
  266. option(value='BW') Botswana
  267. option(value='BV') Bouvet Island
  268. option(value='BR') Brazil
  269. option(value='BQ') British Antarctic Territory
  270. option(value='IO') British Indian Ocean Territory
  271. option(value='VG') British Virgin Islands
  272. option(value='BN') Brunei
  273. option(value='BG') Bulgaria
  274. option(value='BF') Burkina Faso
  275. option(value='BI') Burundi
  276. option(value='KH') Cambodia
  277. option(value='CM') Cameroon
  278. option(value='CA') Canada
  279. option(value='IC') Canary Islands
  280. option(value='CT') Canton and Enderbury Islands
  281. option(value='CV') Cape Verde
  282. option(value='KY') Cayman Islands
  283. option(value='CF') Central African Republic
  284. option(value='EA') Ceuta and Melilla
  285. option(value='TD') Chad
  286. option(value='CL') Chile
  287. option(value='CN') China
  288. option(value='CX') Christmas Island
  289. option(value='CP') Clipperton Island
  290. option(value='CC') Cocos [Keeling] Islands
  291. option(value='CO') Colombia
  292. option(value='KM') Comoros
  293. option(value='CD') Congo [DRC]
  294. option(value='CK') Cook Islands
  295. option(value='CR') Costa Rica
  296. option(value='HR') Croatia
  297. option(value='CU') Cuba
  298. option(value='CY') Cyprus
  299. option(value='CZ') Czech Republic
  300. option(value='DK') Denmark
  301. option(value='DG') Diego Garcia
  302. option(value='DJ') Djibouti
  303. option(value='DM') Dominica
  304. option(value='DO') Dominican Republic
  305. option(value='NQ') Dronning Maud Land
  306. option(value='TL') East Timor
  307. option(value='EC') Ecuador
  308. option(value='EG') Egypt
  309. option(value='SV') El Salvador
  310. option(value='EE') Estonia
  311. option(value='ET') Ethiopia
  312. option(value='FK') Falkland Islands [Islas Malvinas]
  313. option(value='FO') Faroe Islands
  314. option(value='FJ') Fiji
  315. option(value='FI') Finland
  316. option(value='FR') France
  317. option(value='GF') French Guiana
  318. option(value='PF') French Polynesia
  319. option(value='TF') French Southern Territories
  320. option(value='FQ') French Southern and Antarctic Territories
  321. option(value='GA') Gabon
  322. option(value='GM') Gambia
  323. option(value='GE') Georgia
  324. option(value='DE') Germany
  325. option(value='GH') Ghana
  326. option(value='GI') Gibraltar
  327. option(value='GR') Greece
  328. option(value='GL') Greenland
  329. option(value='GD') Grenada
  330. option(value='GP') Guadeloupe
  331. option(value='GU') Guam
  332. option(value='GT') Guatemala
  333. option(value='GG') Guernsey
  334. option(value='GW') Guinea-Bissau
  335. option(value='GY') Guyana
  336. option(value='HT') Haiti
  337. option(value='HM') Heard Island and McDonald Islands
  338. option(value='HN') Honduras
  339. option(value='HK') Hong Kong
  340. option(value='HU') Hungary
  341. option(value='IS') Iceland
  342. option(value='IN') India
  343. option(value='ID') Indonesia
  344. option(value='IE') Ireland
  345. option(value='IM') Isle of Man
  346. option(value='IL') Israel
  347. option(value='IT') Italy
  348. option(value='JM') Jamaica
  349. option(value='JP') Japan
  350. option(value='JE') Jersey
  351. option(value='JT') Johnston Island
  352. option(value='JO') Jordan
  353. option(value='KZ') Kazakhstan
  354. option(value='KE') Kenya
  355. option(value='KI') Kiribati
  356. option(value='KW') Kuwait
  357. option(value='KG') Kyrgyzstan
  358. option(value='LA') Laos
  359. option(value='LV') Latvia
  360. option(value='LS') Lesotho
  361. option(value='LY') Libya
  362. option(value='LI') Liechtenstein
  363. option(value='LT') Lithuania
  364. option(value='LU') Luxembourg
  365. option(value='MO') Macau
  366. option(value='MK') Macedonia [FYROM]
  367. option(value='MG') Madagascar
  368. option(value='MW') Malawi
  369. option(value='MY') Malaysia
  370. option(value='MV') Maldives
  371. option(value='ML') Mali
  372. option(value='MT') Malta
  373. option(value='MH') Marshall Islands
  374. option(value='MQ') Martinique
  375. option(value='MR') Mauritania
  376. option(value='MU') Mauritius
  377. option(value='YT') Mayotte
  378. option(value='FX') Metropolitan France
  379. option(value='MX') Mexico
  380. option(value='FM') Micronesia
  381. option(value='MI') Midway Islands
  382. option(value='MD') Moldova
  383. option(value='MC') Monaco
  384. option(value='MN') Mongolia
  385. option(value='ME') Montenegro
  386. option(value='MS') Montserrat
  387. option(value='MA') Morocco
  388. option(value='MZ') Mozambique
  389. option(value='NA') Namibia
  390. option(value='NR') Nauru
  391. option(value='NP') Nepal
  392. option(value='NL') Netherlands
  393. option(value='AN') Netherlands Antilles
  394. option(value='NT') Neutral Zone
  395. option(value='NC') New Caledonia
  396. option(value='NZ') New Zealand
  397. option(value='NI') Nicaragua
  398. option(value='NE') Niger
  399. option(value='NG') Nigeria
  400. option(value='NU') Niue
  401. option(value='NF') Norfolk Island
  402. option(value='VD') North Vietnam
  403. option(value='MP') Northern Mariana Islands
  404. option(value='NO') Norway
  405. option(value='OM') Oman
  406. option(value='QO') Outlying Oceania
  407. option(value='PC') Pacific Islands Trust Territory
  408. option(value='PK') Pakistan
  409. option(value='PW') Palau
  410. option(value='PS') Palestinian Territories
  411. option(value='PA') Panama
  412. option(value='PZ') Panama Canal Zone
  413. option(value='PY') Paraguay
  414. option(value='YD') People's Democratic Republic of Yemen
  415. option(value='PE') Peru
  416. option(value='PH') Philippines
  417. option(value='PN') Pitcairn Islands
  418. option(value='PL') Poland
  419. option(value='PT') Portugal
  420. option(value='PR') Puerto Rico
  421. option(value='QA') Qatar
  422. option(value='RO') Romania
  423. option(value='RU') Russia
  424. option(value='RW') Rwanda
  425. option(value='RE') Réunion
  426. option(value='BL') Saint Barthélemy
  427. option(value='SH') Saint Helena
  428. option(value='KN') Saint Kitts and Nevis
  429. option(value='LC') Saint Lucia
  430. option(value='MF') Saint Martin
  431. option(value='PM') Saint Pierre and Miquelon
  432. option(value='VC') Saint Vincent and the Grenadines
  433. option(value='WS') Samoa
  434. option(value='SM') San Marino
  435. option(value='SA') Saudi Arabia
  436. option(value='SN') Senegal
  437. option(value='RS') Serbia
  438. option(value='CS') Serbia and Montenegro
  439. option(value='SC') Seychelles
  440. option(value='SL') Sierra Leone
  441. option(value='SG') Singapore
  442. option(value='SK') Slovakia
  443. option(value='SI') Slovenia
  444. option(value='SB') Solomon Islands
  445. option(value='ZA') South Africa
  446. option(value='GS') South Georgia and the South Sandwich Islands
  447. option(value='KR') South Korea
  448. option(value='ES') Spain
  449. option(value='LK') Sri Lanka
  450. option(value='SR') Suriname
  451. option(value='SJ') Svalbard and Jan Mayen
  452. option(value='SZ') Swaziland
  453. option(value='SE') Sweden
  454. option(value='CH') Switzerland
  455. option(value='ST') São Tomé and Príncipe
  456. option(value='TW') Taiwan
  457. option(value='TJ') Tajikistan
  458. option(value='TZ') Tanzania
  459. option(value='TH') Thailand
  460. option(value='TG') Togo
  461. option(value='TK') Tokelau
  462. option(value='TO') Tonga
  463. option(value='TT') Trinidad and Tobago
  464. option(value='TA') Tristan da Cunha
  465. option(value='TN') Tunisia
  466. option(value='TR') Turkey
  467. option(value='TM') Turkmenistan
  468. option(value='TC') Turks and Caicos Islands
  469. option(value='TV') Tuvalu
  470. option(value='UM') U.S. Minor Outlying Islands
  471. option(value='PU') U.S. Miscellaneous Pacific Islands
  472. option(value='VI') U.S. Virgin Islands
  473. option(value='UG') Uganda
  474. option(value='UA') Ukraine
  475. option(value='AE') United Arab Emirates
  476. option(value='GB') United Kingdom
  477. option(value='US') United States
  478. option(value='UY') Uruguay
  479. option(value='UZ') Uzbekistan
  480. option(value='VU') Vanuatu
  481. option(value='VA') Vatican City
  482. option(value='VE') Venezuela
  483. option(value='VN') Vietnam
  484. option(value='WK') Wake Island
  485. option(value='WF') Wallis and Futuna
  486. option(value='EH') Western Sahara
  487. option(value='YE') Yemen
  488. option(value='ZM') Zambia
  489. option(value='AX') Åland Islands