settings.pug 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. extends ../layout
  2. block content
  3. .content.content-alt
  4. .container
  5. .row
  6. .col-md-12.col-lg-10.col-lg-offset-1
  7. .card
  8. .page-header
  9. h1 #{translate("account_settings")}
  10. .account-settings(ng-controller="AccountSettingsController", ng-cloak)
  11. if hasFeature('affiliations')
  12. include settings/user-affiliations
  13. form-messages(for="settingsForm")
  14. .alert.alert-success(ng-show="settingsForm.response.success")
  15. | #{translate("thanks_settings_updated")}
  16. form-messages(for="changePasswordForm")
  17. .row
  18. .col-md-5
  19. h3 #{translate("update_account_info")}
  20. form(async-form="settings", name="settingsForm", method="POST", action="/user/settings", novalidate)
  21. input(type="hidden", name="_csrf", value=csrfToken)
  22. if !hasFeature('affiliations')
  23. if !externalAuthenticationSystemUsed()
  24. .form-group
  25. label(for='email') #{translate("email")}
  26. input.form-control(
  27. type='email',
  28. name='email',
  29. placeholder="email@example.com"
  30. required,
  31. ng-model="email",
  32. ng-init="email = "+JSON.stringify(user.email),
  33. ng-model-options="{ pdateOn: 'blur' }"
  34. )
  35. span.small.text-primary(ng-show="settingsForm.email.$invalid && settingsForm.email.$dirty")
  36. | #{translate("must_be_email_address")}
  37. else
  38. // show the email, non-editable
  39. .form-group
  40. label.control-label #{translate("email")}
  41. div.form-control(
  42. readonly="true",
  43. ng-non-bindable
  44. ) #{user.email}
  45. if shouldAllowEditingDetails
  46. .form-group
  47. label(for='firstName').control-label #{translate("first_name")}
  48. input.form-control(
  49. type='text',
  50. name='first_name',
  51. value=user.first_name
  52. ng-non-bindable
  53. )
  54. .form-group
  55. label(for='lastName').control-label #{translate("last_name")}
  56. input.form-control(
  57. type='text',
  58. name='last_name',
  59. value=user.last_name
  60. ng-non-bindable
  61. )
  62. .actions
  63. button.btn.btn-primary(
  64. type='submit',
  65. ng-disabled="settingsForm.$invalid"
  66. ) #{translate("update")}
  67. else
  68. .form-group
  69. label.control-label #{translate("first_name")}
  70. div.form-control(
  71. readonly="true",
  72. ng-non-bindable
  73. ) #{user.first_name}
  74. .form-group
  75. label.control-label #{translate("last_name")}
  76. div.form-control(
  77. readonly="true",
  78. ng-non-bindable
  79. ) #{user.last_name}
  80. .col-md-5.col-md-offset-1
  81. h3 #{translate("change_password")}
  82. if externalAuthenticationSystemUsed() && !settings.overleaf
  83. p
  84. Password settings are managed externally
  85. else
  86. - var submitAction
  87. if settings.overleaf
  88. - submitAction = '/user/change_password/v1'
  89. else
  90. - submitAction = '/user/password/update'
  91. form(
  92. async-form="changepassword"
  93. name="changePasswordForm"
  94. action=submitAction
  95. method="POST"
  96. novalidate
  97. )
  98. input(type="hidden", name="_csrf", value=csrfToken)
  99. .form-group
  100. label(for='currentPassword') #{translate("current_password")}
  101. input.form-control(
  102. type='password',
  103. name='currentPassword',
  104. placeholder='*********',
  105. ng-model="currentPassword",
  106. required
  107. )
  108. span.small.text-primary(ng-show="changePasswordForm.currentPassword.$invalid && changePasswordForm.currentPassword.$dirty")
  109. | #{translate("required")}
  110. .form-group
  111. label(for='newPassword1') #{translate("new_password")}
  112. input.form-control(
  113. id='passwordField',
  114. type='password',
  115. name='newPassword1',
  116. placeholder='*********',
  117. ng-model="newPassword1",
  118. required,
  119. complex-password
  120. )
  121. span.small.text-primary(ng-show="changePasswordForm.newPassword1.$error.complexPassword && changePasswordForm.newPassword1.$dirty", ng-bind-html="complexPasswordErrorMessage")
  122. .form-group
  123. label(for='newPassword2') #{translate("confirm_new_password")}
  124. input.form-control(
  125. type='password',
  126. name='newPassword2',
  127. placeholder='*********',
  128. ng-model="newPassword2",
  129. equals="passwordField"
  130. )
  131. span.small.text-primary(ng-show="changePasswordForm.newPassword2.$error.areEqual && changePasswordForm.newPassword2.$dirty")
  132. | #{translate("doesnt_match")}
  133. span.small.text-primary(ng-show="!changePasswordForm.newPassword2.$error.areEqual && changePasswordForm.newPassword2.$invalid && changePasswordForm.newPassword2.$dirty")
  134. | #{translate("invalid_password")}
  135. .actions
  136. button.btn.btn-primary(
  137. type='submit',
  138. ng-disabled="changePasswordForm.$invalid"
  139. ) #{translate("change")}
  140. | !{moduleIncludes("userSettings", locals)}
  141. hr
  142. h3
  143. | #{translate("sharelatex_beta_program")}
  144. if (user.betaProgram)
  145. p.small
  146. | #{translate("beta_program_already_participating")}
  147. div
  148. a(id="beta-program-participate-link" href="/beta/participate") #{translate("manage_beta_program_membership")}
  149. hr
  150. h3
  151. | #{translate("sessions")}
  152. div
  153. a(id="sessions-link", href="/user/sessions") #{translate("manage_sessions")}
  154. if settings.overleaf && !hasFeature('oauth')
  155. hr
  156. p
  157. | To manage your account's connection to Google, Twitter, ORCID and IEEE, please
  158. |
  159. a(href="/sign_in_to_v1?return_to=/users/edit#linked-accounts") click here
  160. | .
  161. else if hasFeature('oauth')
  162. hr
  163. include settings/user-oauth
  164. hr
  165. if !externalAuthenticationSystemUsed() || (settings.createV1AccountOnLogin && settings.overleaf)
  166. p.small
  167. | #{translate("newsletter_info_and_unsubscribe")}
  168. a(
  169. href,
  170. ng-click="unsubscribe()",
  171. ng-show="subscribed && !unsubscribing"
  172. ) #{translate("unsubscribe")}
  173. span(
  174. ng-show="unsubscribing"
  175. )
  176. i.fa.fa-spin.fa-refresh(aria-hidden="true")
  177. | #{translate("unsubscribing")}
  178. span.text-success(
  179. ng-show="!subscribed"
  180. )
  181. i.fa.fa-check(aria-hidden="true")
  182. | #{translate("unsubscribed")}
  183. if !settings.overleaf && user.overleaf
  184. p
  185. | Please note: If you have linked your account with Overleaf
  186. | v2, then deleting your ShareLaTeX account will also delete
  187. | account and all of it's associated projects and data.
  188. p #{translate("need_to_leave")}
  189. a(href, ng-click="deleteAccount()") #{translate("delete_your_account")}
  190. script(type='text/ng-template', id='deleteAccountModalTemplate')
  191. .modal-header
  192. h3 #{translate("delete_account")}
  193. div.modal-body#delete-account-modal
  194. p !{translate("delete_account_warning_message_3")}
  195. if settings.createV1AccountOnLogin && settings.overleaf
  196. if settings.forceImportToV2
  197. p
  198. strong
  199. | Your Overleaf v2 projects will be deleted if you delete your account.
  200. | If you want to remove any remaining Overleaf v1 projects in your account,
  201. | please first make sure they are imported to Overleaf v2.
  202. else
  203. p
  204. strong
  205. | This will also delete your user account on #[a(href='/sign_in_to_v1?return_to=/dash%3Fprefer-v1-dash%3D1' target="_blank") Overleaf v1].
  206. | If you want to remove your projects from Overleaf v1, you must do this before you
  207. | delete your account by going to your My Projects page in Overleaf v1, moving your
  208. | projects to the Trash, and then from there either ‘leaving’ or ‘purging’ them, as appropriate.
  209. form(novalidate, name="deleteAccountForm")
  210. label #{translate('email')}
  211. input.form-control(
  212. type="text",
  213. autocomplete="off",
  214. placeholder="",
  215. ng-model="state.deleteText",
  216. focus-on="open",
  217. ng-keyup="checkValidation()"
  218. )
  219. label #{translate('password')}
  220. input.form-control(
  221. type="password",
  222. autocomplete="off",
  223. placeholder="",
  224. ng-model="state.password",
  225. ng-keyup="checkValidation()"
  226. )
  227. div.confirmation-checkbox-wrapper
  228. input(
  229. type="checkbox"
  230. ng-model="state.confirmV1Purge"
  231. ng-change="checkValidation()"
  232. ).pull-left
  233. label(style="display: inline")  I have left, purged or imported my projects on Overleaf v1 (if any)  
  234. div.confirmation-checkbox-wrapper
  235. input(
  236. type="checkbox"
  237. ng-model="state.confirmSharelatexDelete"
  238. ng-change="checkValidation()"
  239. ).pull-left
  240. label(style="display: inline")  I understand this will delete all projects in my Overleaf v2 account (and ShareLaTeX account, if any) with email address #[em {{ userDefaultEmail }}]
  241. div(ng-if="state.error")
  242. div.alert.alert-danger
  243. | #{translate('generic_something_went_wrong')}
  244. div(ng-if="state.invalidCredentials")
  245. div.alert.alert-danger
  246. | #{translate('email_or_password_wrong_try_again')}
  247. if settings.createV1AccountOnLogin && settings.overleaf
  248. div(ng-if="state.error || state.invalidCredentials")
  249. div.alert.alert-info
  250. | If you can't remember your password, or if you are using Single-Sign-On with another provider
  251. | to sign in (such as Twitter or Google), please
  252. | #[a(href="/user/password/reset", target='_blank') reset your password],
  253. | and try again.
  254. .modal-footer
  255. button.btn.btn-default(
  256. ng-click="cancel()"
  257. ) #{translate("cancel")}
  258. button.btn.btn-danger(
  259. ng-disabled="!state.isValid || state.inflight"
  260. ng-click="delete()"
  261. )
  262. span(ng-hide="state.inflight") #{translate("delete")}
  263. span(ng-show="state.inflight") #{translate("deleting")}...
  264. script(type='text/javascript').
  265. window.passwordStrengthOptions = !{JSON.stringify(settings.passwordStrengthOptions || {})}