settings.jade 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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", method="POST", action="/user/settings", novalidate)
  20. input(type="hidden", name="_csrf", value=csrfToken)
  21. if !externalAuthenticationSystemUsed()
  22. .form-group
  23. label(for='email') #{translate("email")}
  24. input.form-control(
  25. type='email',
  26. name='email',
  27. placeholder="email@example.com"
  28. required,
  29. ng-model="email",
  30. ng-init="email = #{JSON.stringify(user.email)}",
  31. ng-model-options="{ updateOn: 'blur' }"
  32. )
  33. span.small.text-primary(ng-show="settingsForm.email.$invalid && settingsForm.email.$dirty")
  34. | #{translate("must_be_email_address")}
  35. .form-group
  36. label(for='firstName').control-label #{translate("first_name")}
  37. input.form-control(
  38. type='text',
  39. name='first_name',
  40. value=user.first_name
  41. )
  42. .form-group
  43. label(for='lastName').control-label #{translate("last_name")}
  44. input.form-control(
  45. type='text',
  46. name='last_name',
  47. value=user.last_name
  48. )
  49. .actions
  50. button.btn.btn-primary(
  51. type='submit',
  52. ng-disabled="settingsForm.$invalid"
  53. ) #{translate("update")}
  54. if !externalAuthenticationSystemUsed()
  55. .col-md-5.col-md-offset-1
  56. h3 #{translate("change_password")}
  57. form(async-form="changepassword", name="changePasswordForm", action="/user/password/update", method="POST", novalidate)
  58. input(type="hidden", name="_csrf", value=csrfToken)
  59. .form-group
  60. label(for='currentPassword') #{translate("current_password")}
  61. input.form-control(
  62. type='password',
  63. name='currentPassword',
  64. placeholder='*********',
  65. ng-model="currentPassword",
  66. required
  67. )
  68. span.small.text-primary(ng-show="changePasswordForm.currentPassword.$invalid && changePasswordForm.currentPassword.$dirty")
  69. | #{translate("required")}
  70. .form-group
  71. label(for='newPassword1') #{translate("new_password")}
  72. input.form-control(
  73. id='passwordField',
  74. type='password',
  75. name='newPassword1',
  76. placeholder='*********',
  77. ng-model="newPassword1",
  78. required,
  79. complex-password
  80. )
  81. span.small.text-primary(ng-show="changePasswordForm.newPassword1.$error.complexPassword && changePasswordForm.currentPassword.$dirty", ng-bind-html="complexPasswordErrorMessage")
  82. .form-group
  83. label(for='newPassword2') #{translate("confirm_new_password")}
  84. input.form-control(
  85. type='password',
  86. name='newPassword2',
  87. placeholder='*********',
  88. ng-model="newPassword2",
  89. equals="passwordField"
  90. )
  91. span.small.text-primary(ng-show="changePasswordForm.newPassword2.$invalid && changePasswordForm.newPassword2.$dirty")
  92. | #{translate("doesnt_match")}
  93. .actions
  94. button.btn.btn-primary(
  95. type='submit',
  96. ng-disabled="changePasswordForm.$invalid"
  97. ) #{translate("change")}
  98. | !{moduleIncludes("userSettings", locals)}
  99. hr
  100. if !externalAuthenticationSystemUsed()
  101. p.small
  102. | #{translate("newsletter_info_and_unsubscribe")}
  103. a(
  104. href,
  105. ng-click="unsubscribe()",
  106. ng-show="subscribed && !unsubscribing"
  107. ) #{translate("unsubscribe")}
  108. span(
  109. ng-show="unsubscribing"
  110. )
  111. i.fa.fa-spin.fa-refresh
  112. | #{translate("unsubscribing")}
  113. span.text-success(
  114. ng-show="!subscribed"
  115. )
  116. i.fa.fa-check
  117. | #{translate("unsubscribed")}
  118. p #{translate("need_to_leave")}
  119. a(href, ng-click="deleteAccount()") #{translate("delete_your_account")}
  120. script(type='text/ng-template', id='deleteAccountModalTemplate')
  121. .modal-header
  122. h3 #{translate("delete_account")}
  123. .modal-body
  124. p !{translate("delete_account_warning_message")}
  125. form(novalidate, name="deleteAccountForm")
  126. input.form-control(
  127. type="text",
  128. placeholder="",
  129. ng-model="state.deleteText",
  130. focus-on="open",
  131. ng-keyup="checkValidation()"
  132. )
  133. .modal-footer
  134. button.btn.btn-default(
  135. ng-click="cancel()"
  136. ) #{translate("cancel")}
  137. button.btn.btn-danger(
  138. ng-disabled="!state.isValid || state.inflight"
  139. ng-click="delete()"
  140. )
  141. span(ng-hide="state.inflight") #{translate("delete")}
  142. span(ng-show="state.inflight") #{translate("deleting")}...
  143. script(type='text/javascript').
  144. window.passwordStrengthOptions = !{JSON.stringify(settings.passwordStrengthOptions || {})}