2014-02-12 05:23:40 -05:00
extends ../layout
block content
2014-06-09 05:56:26 -04:00
.content.content-alt
.container
.row
2018-06-15 06:30:34 -04:00
.col-md-12.col-lg-10.col-lg-offset-1
2014-06-20 10:48:00 -04:00
.card
2014-06-09 05:56:26 -04:00
.page-header
2014-07-31 06:54:19 -04:00
h1 #{translate("account_settings")}
2014-06-20 10:48:00 -04:00
.account-settings(ng-controller="AccountSettingsController", ng-cloak)
form-messages(for="settingsForm")
.alert.alert-success(ng-show="settingsForm.response.success")
2014-07-31 06:54:19 -04:00
| #{translate("thanks_settings_updated")}
2014-06-20 10:48:00 -04:00
form-messages(for="changePasswordForm")
.container-fluid
2018-06-21 12:18:01 -04:00
form.row(
ng-controller="UserAffiliationsController"
name="affiliationsForm"
)
.col-md-12
h3 Emails and Affiliations
p.small Add additional email addresses to your account to access any upgrades your university or institution has, to make it easier for collaborators to find you, and to make sure you can recover your account.
table.table.affiliations-table
thead
tr
th.affiliations-table-email Email
th.affiliations-table-institution Institution and role
th.affiliations-table-inline-actions
tbody
tr(
ng-repeat="userEmail in userEmails"
)
td {{ userEmail.email + (userEmail.default ? ' (default)' : '') }}
td {{ userEmail.institution }}
td
a(
href
ng-if="!userEmail.default"
ng-click="setDefaultUserEmail(userEmail.email)"
) Make default
br
a(
href
ng-if="!userEmail.default"
ng-click="removeUserEmail(userEmail.email)"
) Remove
tr(
ng-if="ui.isLoadingEmails"
)
td.text-center(colspan="3")
i.fa.fa-fw.fa-spin.fa-refresh
| Loading...
tr(
ng-if="!ui.showAddEmailUI && !ui.isLoadingEmails"
)
td(colspan="3")
a(
href
ng-click="showAddEmailForm()"
) Add new email
tr(
ng-if="ui.showAddEmailUI"
)
td
p
input-suggestions(
ng-model="newAffiliation.email"
ng-model-options="{ allowInvalid: true }"
get-suggestion="getEmailSuggestion(userInput)"
on-blur="handleEmailInputBlur()"
input-id="affilitations-email"
input-name="affilitationsEmail"
input-placeholder="e.g. johndoe@mit.edu"
input-type="email"
input-required="true"
)
td
p(
ng-if="newAffiliation.university && !ui.showManualUniversitySelectionUI"
)
| {{ newAffiliation.university.name }} (
a(
href
ng-click="selectUniversityManually();"
) change
| )
p(
ng-if="!newAffiliation.university && !ui.isValidEmail && !ui.showManualUniversitySelectionUI"
) Start by adding your email address.
p(
ng-if="!newAffiliation.university && ui.isValidEmail && !ui.isBlacklistedEmail && !ui.showManualUniversitySelectionUI"
)
| Is your email affiliated with an institution?
br
a(
href
ng-click="selectUniversityManually();"
) Let us know
div(
ng-if="ui.showManualUniversitySelectionUI"
)
p
ui-select(
ng-model="newAffiliation.country"
)
ui-select-match(
placeholder="Select your country"
) {{ $select.selected.name }}
ui-select-choices(
repeat="country in countries | filter: $select.search"
)
span(
ng-bind="country.name"
)
p
ui-select(
ng-model="newAffiliation.university"
ng-disabled="!newAffiliation.country"
tagging="addUniversityToSelection"
tagging-label="false"
)
ui-select-match(
placeholder="Select your university"
) {{ $select.selected.name }}
ui-select-choices(
repeat="university in universities | filter: $select.search"
)
span(
ng-bind="university.name"
)
div(
ng-if="ui.isValidEmail && newAffiliation.university"
)
p
input.form-control(
type="text"
id="affiliations-role"
placeholder="Role"
ng-model="newAffiliation.role"
)
p
input.form-control(
type="text"
id="affiliations-department"
placeholder="Department"
ng-model="newAffiliation.department"
)
td
button.btn.btn-primary(
ng-disabled="affiliationsForm.$invalid || ui.isAddingNewEmail"
ng-click="addNewEmail()"
)
span(
ng-if="!ui.isAddingNewEmail"
) Add new email
span(
ng-if="ui.isAddingNewEmail"
)
i.fa.fa-fw.fa-spin.fa-refresh
| Adding...
hr
2014-06-20 10:48:00 -04:00
.row
.col-md-5
2014-07-31 06:54:19 -04:00
h3 #{translate("update_account_info")}
2014-11-17 10:19:11 -05:00
form(async-form="settings", name="settingsForm", method="POST", action="/user/settings", novalidate)
2014-06-20 10:48:00 -04:00
input(type="hidden", name="_csrf", value=csrfToken)
2015-02-24 08:39:30 -05:00
if !externalAuthenticationSystemUsed()
.form-group
label(for='email') #{translate("email")}
input.form-control(
type='email',
name='email',
placeholder="email@example.com"
required,
ng-model="email",
2017-01-31 09:57:22 -05:00
ng-init="email = "+JSON.stringify(user.email),
2015-02-24 08:39:30 -05:00
ng-model-options="{ updateOn: 'blur' }"
)
span.small.text-primary(ng-show="settingsForm.email.$invalid && settingsForm.email.$dirty")
| #{translate("must_be_email_address")}
2016-11-17 09:34:02 -05:00
else
// show the email, non-editable
.form-group
label.control-label #{translate("email")}
div.form-control(readonly="true") #{user.email}
2016-11-25 09:38:00 -05:00
if shouldAllowEditingDetails
.form-group
label(for='firstName').control-label #{translate("first_name")}
input.form-control(
type='text',
name='first_name',
value=user.first_name
2017-06-08 11:02:28 -04:00
ng-non-bindable
2016-11-25 09:38:00 -05:00
)
.form-group
label(for='lastName').control-label #{translate("last_name")}
input.form-control(
type='text',
name='last_name',
value=user.last_name
2017-06-08 11:02:28 -04:00
ng-non-bindable
2016-11-25 09:38:00 -05:00
)
.actions
button.btn.btn-primary(
type='submit',
ng-disabled="settingsForm.$invalid"
) #{translate("update")}
else
.form-group
label.control-label #{translate("first_name")}
div.form-control(readonly="true") #{user.first_name}
.form-group
label.control-label #{translate("last_name")}
div.form-control(readonly="true") #{user.last_name}
2015-02-24 08:39:30 -05:00
if !externalAuthenticationSystemUsed()
.col-md-5.col-md-offset-1
h3 #{translate("change_password")}
form(async-form="changepassword", name="changePasswordForm", action="/user/password/update", method="POST", novalidate)
input(type="hidden", name="_csrf", value=csrfToken)
.form-group
label(for='currentPassword') #{translate("current_password")}
input.form-control(
type='password',
name='currentPassword',
placeholder='*********',
ng-model="currentPassword",
required
)
span.small.text-primary(ng-show="changePasswordForm.currentPassword.$invalid && changePasswordForm.currentPassword.$dirty")
| #{translate("required")}
.form-group
label(for='newPassword1') #{translate("new_password")}
input.form-control(
2015-04-28 13:30:19 -04:00
id='passwordField',
2015-02-24 08:39:30 -05:00
type='password',
name='newPassword1',
placeholder='*********',
ng-model="newPassword1",
2015-04-28 13:30:19 -04:00
required,
complex-password
2015-02-24 08:39:30 -05:00
)
2016-09-23 10:44:47 -04:00
span.small.text-primary(ng-show="changePasswordForm.newPassword1.$error.complexPassword && changePasswordForm.newPassword1.$dirty", ng-bind-html="complexPasswordErrorMessage")
2015-02-24 08:39:30 -05:00
.form-group
label(for='newPassword2') #{translate("confirm_new_password")}
input.form-control(
type='password',
name='newPassword2',
placeholder='*********',
ng-model="newPassword2",
2015-04-28 13:30:19 -04:00
equals="passwordField"
2016-09-23 10:44:47 -04:00
)
span.small.text-primary(ng-show="changePasswordForm.newPassword2.$error.areEqual && changePasswordForm.newPassword2.$dirty")
| #{translate("doesnt_match")}
span.small.text-primary(ng-show="!changePasswordForm.newPassword2.$error.areEqual && changePasswordForm.newPassword2.$invalid && changePasswordForm.newPassword2.$dirty")
2017-02-17 06:05:27 -05:00
| #{translate("invalid_password")}
2015-02-24 08:39:30 -05:00
.actions
button.btn.btn-primary(
type='submit',
ng-disabled="changePasswordForm.$invalid"
) #{translate("change")}
2014-02-12 05:23:40 -05:00
2018-06-21 12:18:01 -04:00
2018-06-15 06:30:34 -04:00
2014-09-08 10:40:46 -04:00
| !{moduleIncludes("userSettings", locals)}
2014-02-12 05:23:40 -05:00
2018-03-19 13:02:27 -04:00
//- The beta program doesn't make much sense to include while v2 is going
//- but we may want to add it back in later
//- hr
//-
//- h3
//- | #{translate("sharelatex_beta_program")}
//-
//- if (user.betaProgram)
//- p.small
//- | #{translate("beta_program_already_participating")}
//-
//- div
//- a(id="beta-program-participate-link" href="/beta/participate") #{translate("manage_beta_program_membership")}
2016-06-08 10:31:14 -04:00
2014-10-07 08:31:13 -04:00
hr
2016-10-07 05:52:58 -04:00
h3
| #{translate("sessions")}
div
a(id="sessions-link", href="/user/sessions") #{translate("manage_sessions")}
hr
2014-02-12 05:23:40 -05:00
2015-02-24 08:39:30 -05:00
if !externalAuthenticationSystemUsed()
2014-06-20 10:48:00 -04:00
2015-02-24 08:39:30 -05:00
p.small
| #{translate("newsletter_info_and_unsubscribe")}
a(
href,
ng-click="unsubscribe()",
ng-show="subscribed && !unsubscribing"
) #{translate("unsubscribe")}
span(
ng-show="unsubscribing"
)
i.fa.fa-spin.fa-refresh
| #{translate("unsubscribing")}
span.text-success(
ng-show="!subscribed"
)
i.fa.fa-check
| #{translate("unsubscribed")}
p #{translate("need_to_leave")}
a(href, ng-click="deleteAccount()") #{translate("delete_your_account")}
2014-06-20 10:48:00 -04:00
script(type='text/ng-template', id='deleteAccountModalTemplate')
.modal-header
2014-07-31 06:54:19 -04:00
h3 #{translate("delete_account")}
2016-10-25 11:23:50 -04:00
div.modal-body#delete-account-modal
p !{translate("delete_account_warning_message_3")}
2014-06-20 10:48:00 -04:00
form(novalidate, name="deleteAccountForm")
2016-10-25 09:33:47 -04:00
label #{translate('email')}
2014-06-20 10:48:00 -04:00
input.form-control(
type="text",
2016-10-26 05:57:54 -04:00
autocomplete="off",
2014-06-20 10:48:00 -04:00
placeholder="",
2014-07-28 11:52:23 -04:00
ng-model="state.deleteText",
focus-on="open",
ng-keyup="checkValidation()"
2014-06-20 10:48:00 -04:00
)
2016-10-25 09:33:47 -04:00
label #{translate('password')}
input.form-control(
type="password",
2016-10-26 05:57:54 -04:00
autocomplete="off",
2016-10-25 09:33:47 -04:00
placeholder="",
ng-model="state.password",
2016-10-25 11:23:50 -04:00
ng-keyup="checkValidation()"
2016-10-25 09:33:47 -04:00
)
div(ng-if="state.error")
div.alert.alert-danger
| #{translate('generic_something_went_wrong')}
2016-10-25 11:23:50 -04:00
div(ng-if="state.invalidCredentials")
div.alert.alert-danger
| #{translate('email_or_password_wrong_try_again')}
2014-06-20 10:48:00 -04:00
.modal-footer
button.btn.btn-default(
ng-click="cancel()"
2014-07-31 06:54:19 -04:00
) #{translate("cancel")}
2014-06-20 10:48:00 -04:00
button.btn.btn-danger(
2014-07-28 11:52:23 -04:00
ng-disabled="!state.isValid || state.inflight"
2014-06-20 10:48:00 -04:00
ng-click="delete()"
)
2014-07-31 06:54:19 -04:00
span(ng-hide="state.inflight") #{translate("delete")}
span(ng-show="state.inflight") #{translate("deleting")}...
2015-04-28 13:30:19 -04:00
script(type='text/javascript').
window.passwordStrengthOptions = !{JSON.stringify(settings.passwordStrengthOptions || {})}
2014-02-22 06:26:36 -05:00