settings.jade 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. extends ../layout
  2. block content
  3. .content.content-alt
  4. .container
  5. .row
  6. .col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
  7. .card
  8. .page-header
  9. h1 #{translate("account_settings")}
  10. .account-settings(ng-controller="AccountSettingsController", ng-cloak)
  11. form-messages(for="settingsForm")
  12. .alert.alert-success(ng-show="settingsForm.response.success")
  13. | #{translate("thanks_settings_updated")}
  14. form-messages(for="changePasswordForm")
  15. .container-fluid
  16. .row
  17. .col-md-5
  18. h3 #{translate("update_account_info")}
  19. form(async-form="settings", name="settingsForm", action="/user/settings", novalidate)
  20. input(type="hidden", name="_csrf", value=csrfToken)
  21. .form-group
  22. label(for='email') #{translate("email")}
  23. input.form-control(
  24. type='email',
  25. name='email',
  26. placeholder="email@example.com"
  27. required,
  28. ng-model="email",
  29. ng-init="email = #{JSON.stringify(user.email)}",
  30. ng-model-options="{ updateOn: 'blur' }"
  31. )
  32. span.small.text-primary(ng-show="settingsForm.email.$invalid && settingsForm.email.$dirty")
  33. | #{translate("must_be_email_address")}
  34. .form-group
  35. label(for='firstName').control-label #{translate("first_name")}
  36. input.form-control(
  37. type='text',
  38. name='first_name',
  39. value=user.first_name
  40. )
  41. .form-group
  42. label(for='lastName').control-label #{translate("last_name")}
  43. input.form-control(
  44. type='text',
  45. name='last_name',
  46. value=user.last_name
  47. )
  48. .actions
  49. button.btn.btn-primary(
  50. type='submit',
  51. ng-disabled="settingsForm.$invalid"
  52. ) #{translate("update")}
  53. .col-md-5.col-md-offset-1
  54. h3 #{translate("change_password")}
  55. form(async-form="changepassword", name="changePasswordForm", action="/user/password/update", novalidate)
  56. input(type="hidden", name="_csrf", value=csrfToken)
  57. .form-group
  58. label(for='currentPassword') #{translate("current_password")}
  59. input.form-control(
  60. type='password',
  61. name='currentPassword',
  62. placeholder='*********',
  63. ng-model="currentPassword",
  64. required
  65. )
  66. span.small.text-primary(ng-show="changePasswordForm.currentPassword.$invalid && changePasswordForm.currentPassword.$dirty")
  67. | #{translate("required")}
  68. .form-group
  69. label(for='newPassword1') #{translate("new_password")}
  70. input.form-control(
  71. id='newPassword1',
  72. type='password',
  73. name='newPassword1',
  74. placeholder='*********',
  75. ng-model="newPassword1",
  76. required
  77. )
  78. span.small.text-primary(ng-show="changePasswordForm.newPassword1.$invalid && changePasswordForm.newPassword1.$dirty")
  79. | #{translate("required")}
  80. .form-group
  81. label(for='newPassword2') #{translate("confirm_new_password")}
  82. input.form-control(
  83. type='password',
  84. name='newPassword2',
  85. placeholder='*********',
  86. ng-model="newPassword2",
  87. equals="newPassword1"
  88. )
  89. span.small.text-primary(ng-show="changePasswordForm.newPassword2.$invalid && changePasswordForm.newPassword2.$dirty")
  90. | #{translate("doesnt_match")}
  91. .actions
  92. button.btn.btn-primary(
  93. type='submit',
  94. ng-disabled="changePasswordForm.$invalid"
  95. ) #{translate("change")}
  96. hr
  97. h3 #{translate("dropbox_integration")}
  98. span.small
  99. a(href='/help/kb/dropbox-2') (#{translate("learn_more")})
  100. - if(!user.features.dropbox)
  101. p.small #{translate("dropbox_sync_description")}
  102. .alert.alert-info
  103. p #{translate("dropbox_is_premium")}
  104. p
  105. a.btn.btn-info(href='/user/subscription/plans') #{translate("upgrade")}
  106. - else if(userIsRegisteredWithDropbox)
  107. .alert.alert-success #{translate("account_is_linked")}
  108. row
  109. a(href='/dropbox/unlink').btn #{translate("unlink_dropbox")}
  110. - else
  111. p.small #{translate("dropbox_sync_description")}
  112. p
  113. a.btn.btn-info(href='/dropbox/beginAuth') #{translate("link_to_dropbox")}
  114. | !{moduleIncludes("userSettings", locals)}
  115. hr
  116. p.small
  117. | #{translate("newsletter_info_and_unsubscribe")}
  118. a(
  119. href,
  120. ng-click="unsubscribe()",
  121. ng-show="subscribed && !unsubscribing"
  122. ) #{translate("unsubscribe")}
  123. span(
  124. ng-show="unsubscribing"
  125. )
  126. i.fa.fa-spin.fa-refresh
  127. | #{translate("unsubscribing")}
  128. span.text-success(
  129. ng-show="!subscribed"
  130. )
  131. i.fa.fa-check
  132. | #{translate("unsubscribed")}
  133. p #{translate("need_to_leave")}
  134. a(href, ng-click="deleteAccount()") #{translate("delete_your_account")}
  135. script(type='text/ng-template', id='deleteAccountModalTemplate')
  136. .modal-header
  137. h3 #{translate("delete_account")}
  138. .modal-body
  139. p !{translate("delete_account_warning_message")}
  140. form(novalidate, name="deleteAccountForm")
  141. input.form-control(
  142. type="text",
  143. placeholder="",
  144. ng-model="state.deleteText",
  145. focus-on="open",
  146. ng-keyup="checkValidation()"
  147. )
  148. .modal-footer
  149. button.btn.btn-default(
  150. ng-click="cancel()"
  151. ) #{translate("cancel")}
  152. button.btn.btn-danger(
  153. ng-disabled="!state.isValid || state.inflight"
  154. ng-click="delete()"
  155. )
  156. span(ng-hide="state.inflight") #{translate("delete")}
  157. span(ng-show="state.inflight") #{translate("deleting")}...