Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit e174eaa

Browse files
author
Nick Litwin
committed
Show and hide password section depending on whether user is a social registrant
1 parent d0dfd3b commit e174eaa

File tree

2 files changed

+37
-40
lines changed

2 files changed

+37
-40
lines changed

app/settings/account-info/account-info.controller.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
UserService.getUserProfile({fields: 'credential'})
2727
.then(function(res) {
28-
console.log("RES: ", res.plain().credential.hasPassword);
2928
vm.isSocialRegistrant = !res.credential.hasPassword;
3029
})
3130
.catch(function(err) {

app/settings/account-info/account-info.jade

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,26 @@
1111
.form-label Email
1212
input.form-field.grey(name="email", value="{{vm.userData.email}}", disabled=true)
1313

14-
div(ng-hide="vm.isSocialRegistration")
14+
div(ng-hide="vm.isSocialRegistrant")
1515
form(name="vm.newPasswordForm", role="form", ng-submit="vm.newPasswordForm.$valid && vm.submitNewPassword()", novalidate)
1616
.form-label Current password
1717

1818
.validation-bar(ng-class="{ 'error-bar': (vm.newPasswordForm.currentPassword.$dirty && vm.newPasswordForm.currentPassword.$invalid) }")
19-
toggle-password.tc-input.password(
20-
ng-model="vm.currentPassword"
21-
)
19+
toggle-password.tc-input.password(ng-model="vm.currentPassword")
2220

2321
.form-input-error(ng-show="vm.newPasswordForm.currentPassword.$dirty && vm.newPasswordForm.currentPassword.$invalid")
2422
p(ng-show="vm.newPasswordForm.currentPassword.$error.required") This is a required field.
2523

2624
p(ng-show="vm.newPasswordForm.currentPassword.$error.incorrect") Your current password is incorrect. Please check that you entered the right one.
2725

2826
.form-label New Password
27+
2928
.validation-bar
30-
toggle-password-with-tips.tc-input.password(
31-
placeholder="Pick a new password"
32-
)
29+
toggle-password-with-tips.tc-input.password(placeholder="Pick a new password")
30+
3331
.tips.password-tips(ng-show="vm.passwordFocus")
3432
.arrow
33+
3534
h3 Password Tips:
3635

3736
p Your password must have:
@@ -46,49 +45,48 @@
4645
button.tc-btn.save(type="submit", tc-busy-button, tc-busy-when="vm.formProcessing.newPasswordForm", ng-disabled="vm.newPasswordForm.$invalid || vm.newPasswordForm.$pristine", ng-class="{'disabled': vm.newPasswordForm.$invalid || vm.newPasswordForm.$pristine}") Change Password
4746

4847

49-
div(ng-show="vm.isSocialRegistration")
48+
div(ng-show="vm.isSocialRegistrant")
5049
p You joined Topcoder by using an external account, so we don't have a password for you.
5150

52-
5351
form(name="vm.accountInfoForm", role="form", novalidate, autocomplete="off")
54-
5552
.settings-section.name
5653
.section-info
5754
h2 Name
55+
5856
.description Required for legal purposes; will be kept private and not shared with anyone.
5957

6058
.section-fields
59+
// Stops Chrome from autofilling and autocompleting (along with autocomplete="off" on the form)
60+
input(autocomplete="false", name="hidden", type="text", style="display:none;")
6161

62-
// Stops Chrome from autofilling and autocompleting (along with autocomplete="off" on the form)
63-
input(autocomplete="false", name="hidden", type="text", style="display:none;")
64-
.form-label.first First name
65-
span(style="text-transform: none;")  (Given name)
66-
span.mandatory *mandatory
67-
.validation-bar(ng-class="{ 'error-bar': (vm.accountInfoForm.$dirty && vm.accountInfoForm.firstname.$invalid), 'success-bar': (vm.accountInfoForm.$dirty && vm.accountInfoForm.firstname.$valid)}")
68-
input.tc-input(
69-
name="firstname", type="text",
70-
placeholder="First",
71-
ng-model="vm.userData.firstName",
72-
maxlength="64", required,
73-
ng-class="{'form-field-focused': hasFocus==true}"
74-
)
75-
.form-input-error(ng-show="vm.accountInfoForm.firstname.$invalid")
76-
p(ng-show="vm.accountInfoForm.firstname.$error.required") This is a required field.
77-
78-
.form-label Last name
79-
span(style="text-transform: none;")  (Surname)
80-
span.mandatory *mandatory
81-
.validation-bar(ng-class="{ 'error-bar': (vm.accountInfoForm.$dirty && vm.accountInfoForm.lastname.$invalid), 'success-bar': (vm.accountInfoForm.$dirty && vm.accountInfoForm.lastname.$valid)}")
82-
input.tc-input(
83-
name="lastname", type="text",
84-
placeholder="Last",
85-
ng-model="vm.userData.lastName",
86-
maxlength="64", required,
87-
ng-class="{'form-field-focused': hasFocus==true}"
88-
)
89-
.form-input-error(ng-show="vm.accountInfoForm.lastname.$invalid")
90-
p(ng-show="vm.accountInfoForm.lastname.$error.required") This is a required field.
62+
.form-label.first First name
63+
span(style="text-transform: none;")  (Given name)
9164

65+
span.mandatory *mandatory
66+
.validation-bar(ng-class="{ 'error-bar': (vm.accountInfoForm.$dirty && vm.accountInfoForm.firstname.$invalid), 'success-bar': (vm.accountInfoForm.$dirty && vm.accountInfoForm.firstname.$valid)}")
67+
input.tc-input(
68+
name="firstname", type="text",
69+
placeholder="First",
70+
ng-model="vm.userData.firstName",
71+
maxlength="64", required,
72+
ng-class="{'form-field-focused': hasFocus==true}"
73+
)
74+
.form-input-error(ng-show="vm.accountInfoForm.firstname.$invalid")
75+
p(ng-show="vm.accountInfoForm.firstname.$error.required") This is a required field.
76+
77+
.form-label Last name
78+
span(style="text-transform: none;")  (Surname)
79+
span.mandatory *mandatory
80+
.validation-bar(ng-class="{ 'error-bar': (vm.accountInfoForm.$dirty && vm.accountInfoForm.lastname.$invalid), 'success-bar': (vm.accountInfoForm.$dirty && vm.accountInfoForm.lastname.$valid)}")
81+
input.tc-input(
82+
name="lastname", type="text",
83+
placeholder="Last",
84+
ng-model="vm.userData.lastName",
85+
maxlength="64", required,
86+
ng-class="{'form-field-focused': hasFocus==true}"
87+
)
88+
.form-input-error(ng-show="vm.accountInfoForm.lastname.$invalid")
89+
p(ng-show="vm.accountInfoForm.lastname.$error.required") This is a required field.
9290

9391
.settings-section.address
9492
.section-info

0 commit comments

Comments
 (0)