Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
52ffe938
Commit
52ffe938
authored
Oct 20, 2014
by
AlasdairSwan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ECOM-369 added forgot password flow plugged in to Renzo's API
parent
61db0182
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
36 additions
and
43 deletions
+36
-43
lms/envs/common.py
+1
-1
lms/static/js/student_account/models/PasswordResetModel.js
+1
-4
lms/static/js/student_account/views/AccessView.js
+0
-21
lms/static/js/student_account/views/LoginView.js
+2
-2
lms/static/js/student_account/views/PasswordResetView.js
+11
-11
lms/static/js/student_account/views/RegisterView.js
+2
-2
lms/static/sass/views/_login-register.scss
+10
-0
lms/templates/student_account/password_reset.underscore
+8
-1
lms/templates/student_account/register.underscore
+1
-1
No files found.
lms/envs/common.py
View file @
52ffe938
...
@@ -286,7 +286,7 @@ FEATURES = {
...
@@ -286,7 +286,7 @@ FEATURES = {
'ENABLE_VIDEO_ABSTRACTION_LAYER_API'
:
False
,
'ENABLE_VIDEO_ABSTRACTION_LAYER_API'
:
False
,
# Enable the new dashboard, account, and profile pages
# Enable the new dashboard, account, and profile pages
'ENABLE_NEW_DASHBOARD'
:
Fals
e
,
'ENABLE_NEW_DASHBOARD'
:
Tru
e
,
}
}
# Ignore static asset files on import which match this pattern
# Ignore static asset files on import which match this pattern
...
...
lms/static/js/student_account/models/PasswordResetModel.js
View file @
52ffe938
...
@@ -12,7 +12,7 @@ var edx = edx || {};
...
@@ -12,7 +12,7 @@ var edx = edx || {};
email
:
''
email
:
''
},
},
urlRoot
:
'/
resetMe
'
,
urlRoot
:
'/
account/password
'
,
sync
:
function
(
method
,
model
)
{
sync
:
function
(
method
,
model
)
{
var
headers
=
{
var
headers
=
{
...
@@ -27,9 +27,6 @@ var edx = edx || {};
...
@@ -27,9 +27,6 @@ var edx = edx || {};
headers
:
headers
headers
:
headers
})
})
.
done
(
function
()
{
.
done
(
function
()
{
var
query
=
window
.
location
.
search
,
url
=
'/dashboard'
;
model
.
trigger
(
'success'
);
model
.
trigger
(
'success'
);
})
})
.
fail
(
function
(
error
)
{
.
fail
(
function
(
error
)
{
...
...
lms/static/js/student_account/views/AccessView.js
View file @
52ffe938
...
@@ -57,22 +57,10 @@ var edx = edx || {};
...
@@ -57,22 +57,10 @@ var edx = edx || {};
this
.
subview
.
register
=
new
edx
.
student
.
account
.
RegisterView
();
this
.
subview
.
register
=
new
edx
.
student
.
account
.
RegisterView
();
}
else
if
(
type
===
'reset'
)
{
}
else
if
(
type
===
'reset'
)
{
this
.
subview
.
passwordHelp
=
new
edx
.
student
.
account
.
PasswordResetView
();
this
.
subview
.
passwordHelp
=
new
edx
.
student
.
account
.
PasswordResetView
();
// Listen for 'password-reset' event to toggle sub-views
this
.
listenTo
(
this
.
subview
.
passwordHelp
,
'password-reset'
,
this
.
removePasswordView
);
}
}
},
},
removePasswordView
:
function
()
{
this
.
$header
.
removeClass
(
'hidden'
);
$
(
this
.
el
).
find
(
'.form-type'
).
removeClass
(
'hidden'
);
// User should only have to submit reset once so remove view
this
.
subview
.
passwordHelp
.
remove
();
},
resetPassword
:
function
()
{
resetPassword
:
function
()
{
console
.
log
(
this
.
$header
);
this
.
$header
.
addClass
(
'hidden'
);
this
.
$header
.
addClass
(
'hidden'
);
$
(
this
.
el
).
find
(
'.form-type'
).
addClass
(
'hidden'
);
$
(
this
.
el
).
find
(
'.form-type'
).
addClass
(
'hidden'
);
this
.
loadForm
(
'reset'
);
this
.
loadForm
(
'reset'
);
...
@@ -90,15 +78,6 @@ var edx = edx || {};
...
@@ -90,15 +78,6 @@ var edx = edx || {};
$form
.
removeClass
(
'hidden'
);
$form
.
removeClass
(
'hidden'
);
},
},
getModel
:
function
(
type
)
{
var
models
=
{
join
:
app
.
JoinModel
,
login
:
app
.
JoinModel
};
return
models
[
type
]
?
new
models
[
type
]()
:
false
;
},
form
:
{
form
:
{
isLoaded
:
function
(
$form
)
{
isLoaded
:
function
(
$form
)
{
return
$form
.
html
().
length
>
0
;
return
$form
.
html
().
length
>
0
;
...
...
lms/static/js/student_account/views/LoginView.js
View file @
52ffe938
...
@@ -24,7 +24,7 @@ var edx = edx || {};
...
@@ -24,7 +24,7 @@ var edx = edx || {};
$form
:
{},
$form
:
{},
initialize
:
function
(
obj
)
{
initialize
:
function
()
{
this
.
getInitialData
();
this
.
getInitialData
();
},
},
...
@@ -66,7 +66,7 @@ var edx = edx || {};
...
@@ -66,7 +66,7 @@ var edx = edx || {};
});
});
},
},
initModel
:
function
(
url
,
method
)
{
initModel
:
function
(
url
)
{
this
.
model
=
new
edx
.
student
.
account
.
LoginModel
({
this
.
model
=
new
edx
.
student
.
account
.
LoginModel
({
url
:
url
url
:
url
});
});
...
...
lms/static/js/student_account/views/PasswordResetView.js
View file @
52ffe938
...
@@ -25,7 +25,7 @@ var edx = edx || {};
...
@@ -25,7 +25,7 @@ var edx = edx || {};
$form
:
{},
$form
:
{},
initialize
:
function
(
obj
)
{
initialize
:
function
()
{
var
fields
=
this
.
buildForm
([{
var
fields
=
this
.
buildForm
([{
label
:
'E-mail'
,
label
:
'E-mail'
,
instructions
:
'This is the e-mail address you used to register with edX'
,
instructions
:
'This is the e-mail address you used to register with edX'
,
...
@@ -34,7 +34,7 @@ var edx = edx || {};
...
@@ -34,7 +34,7 @@ var edx = edx || {};
type
:
'email'
,
type
:
'email'
,
restrictions
:
[]
restrictions
:
[]
}]);
}]);
console
.
log
(
'PasswordResetView INIT'
);
this
.
initModel
();
this
.
initModel
();
this
.
render
(
fields
);
this
.
render
(
fields
);
},
},
...
@@ -61,13 +61,12 @@ console.log('PasswordResetView INIT');
...
@@ -61,13 +61,12 @@ console.log('PasswordResetView INIT');
this
.
listenTo
(
this
.
model
,
'success'
,
this
.
resetComplete
)
;
this
.
listenTo
(
this
.
model
,
'success'
,
this
.
resetComplete
)
;
},
},
initModel
:
function
(
url
,
method
)
{
initModel
:
function
()
{
console
.
log
(
'init the password reset model'
);
this
.
model
=
new
edx
.
student
.
account
.
PasswordResetModel
();
/*this.model = new edx.student.account.PasswordResetModel();
this
.
listenTo
(
this
.
model
,
'error'
,
function
(
error
)
{
this
.
listenTo
(
this
.
model
,
'error'
,
function
(
error
)
{
console
.
log
(
error
.
status
,
' error: '
,
error
.
responseText
);
console
.
log
(
error
.
status
,
' error: '
,
error
.
responseText
);
});
*/
});
},
},
buildForm
:
function
(
data
)
{
buildForm
:
function
(
data
)
{
...
@@ -75,14 +74,14 @@ console.log('PasswordResetView INIT');
...
@@ -75,14 +74,14 @@ console.log('PasswordResetView INIT');
i
,
i
,
len
=
data
.
length
,
len
=
data
.
length
,
fieldTpl
=
this
.
fieldTpl
;
fieldTpl
=
this
.
fieldTpl
;
console
.
log
(
'buildForm '
,
data
);
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
html
.
push
(
_
.
template
(
fieldTpl
,
$
.
extend
(
data
[
i
],
{
html
.
push
(
_
.
template
(
fieldTpl
,
$
.
extend
(
data
[
i
],
{
form
:
'reset-password'
form
:
'reset-password'
})
)
);
})
)
);
}
}
this
.
render
(
html
.
join
(
''
)
);
return
html
.
join
(
''
);
},
},
getFormData
:
function
()
{
getFormData
:
function
()
{
...
@@ -118,7 +117,10 @@ console.log('buildForm ', data);
...
@@ -118,7 +117,10 @@ console.log('buildForm ', data);
},
},
resetComplete
:
function
()
{
resetComplete
:
function
()
{
this
.
trigger
(
'password-reset'
);
var
$el
=
$
(
this
.
el
);
$el
.
find
(
'#password-reset-form'
).
addClass
(
'hidden'
);
$el
.
find
(
'.js-reset-success'
).
removeClass
(
'hidden'
);
},
},
submitForm
:
function
(
event
)
{
submitForm
:
function
(
event
)
{
...
@@ -126,8 +128,6 @@ console.log('buildForm ', data);
...
@@ -126,8 +128,6 @@ console.log('buildForm ', data);
event
.
preventDefault
();
event
.
preventDefault
();
// console.log(this.model);
if
(
!
this
.
errors
.
length
)
{
if
(
!
this
.
errors
.
length
)
{
console
.
log
(
'save me'
);
console
.
log
(
'save me'
);
this
.
model
.
set
(
data
);
this
.
model
.
set
(
data
);
...
...
lms/static/js/student_account/views/RegisterView.js
View file @
52ffe938
...
@@ -23,7 +23,7 @@ var edx = edx || {};
...
@@ -23,7 +23,7 @@ var edx = edx || {};
$form
:
{},
$form
:
{},
initialize
:
function
(
obj
)
{
initialize
:
function
()
{
this
.
getInitialData
();
this
.
getInitialData
();
},
},
...
@@ -65,7 +65,7 @@ var edx = edx || {};
...
@@ -65,7 +65,7 @@ var edx = edx || {};
});
});
},
},
initModel
:
function
(
url
,
method
)
{
initModel
:
function
(
url
)
{
this
.
model
=
new
edx
.
student
.
account
.
RegisterModel
({
this
.
model
=
new
edx
.
student
.
account
.
RegisterModel
({
url
:
url
url
:
url
});
});
...
...
lms/static/sass/views/_login-register.scss
View file @
52ffe938
...
@@ -5,6 +5,16 @@
...
@@ -5,6 +5,16 @@
@include
span-columns
(
6
);
@include
span-columns
(
6
);
@include
shift
(
3
);
@include
shift
(
3
);
input
:
-
webkit-autofill
{
-webkit-box-shadow
:
0
0
0
50px
white
inset
;
-webkit-text-fill-color
:
#333
;
}
input
:
-
webkit-autofill
:
focus
{
-webkit-box-shadow
:
white
,
0
0
0
50px
white
inset
;
-webkit-text-fill-color
:
#333
;
}
.form-field
{
.form-field
{
width
:
100%
;
width
:
100%
;
}
}
...
...
lms/templates/student_account/password_reset.underscore
View file @
52ffe938
...
@@ -15,7 +15,13 @@
...
@@ -15,7 +15,13 @@
<%= fields %>
<%= fields %>
<button class="action action-primary action-update js-reset">
Create My edX Account
</button>
<button class="action action-primary action-update js-reset">
Reset my password
</button>
</form>
</form>
</div>
</div>
<div class="js-reset-success hidden">
<h2>Password Reset Successful</h2>
<p>We've e-mailed you instructions for setting your password to the e-mail address you submitted. You should be receiving it shortly.</p>
</div>
</section>
</section>
\ No newline at end of file
lms/templates/student_account/register.underscore
View file @
52ffe938
<form id="register">
<form id="register"
autocomplete="off"
>
<div class="error-msg hidden">
<div class="error-msg hidden">
<h4>An error occured in your registration.</h4>
<h4>An error occured in your registration.</h4>
<div class="errors">
<div class="errors">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment