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
d6102373
Commit
d6102373
authored
Oct 21, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5656 from edx/will/logistration-js-work
Combined login/registration JS work
parents
f9d04e42
fabd8a97
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
175 additions
and
15 deletions
+175
-15
common/static/js/spec_helpers/edx.utils.validate.js
+13
-2
lms/djangoapps/student_account/urls.py
+1
-1
lms/envs/common.py
+2
-1
lms/static/js/spec/main.js
+43
-2
lms/static/js/spec/student_account/access_spec.js
+20
-0
lms/static/js/spec/student_account/login_spec.js
+40
-0
lms/static/js/spec/student_account/password_reset_spec.js
+24
-0
lms/static/js/spec/student_account/register_spec.js
+32
-0
lms/templates/student_account/login.underscore
+0
-3
lms/templates/student_account/register.underscore
+0
-6
No files found.
common/static/js/spec_helpers/edx.utils.validate.js
View file @
d6102373
...
@@ -18,6 +18,11 @@ var edx = edx || {};
...
@@ -18,6 +18,11 @@ var edx = edx || {};
},
},
charLength
:
function
(
$el
)
{
charLength
:
function
(
$el
)
{
var
type
=
$el
.
attr
(
"type"
);
if
(
type
!==
"text"
&&
type
!==
"textarea"
&&
type
!==
"password"
)
{
return
true
;
}
// Cannot assume there will be both min and max
// Cannot assume there will be both min and max
var
min
=
$el
.
attr
(
'minlength'
)
||
0
,
var
min
=
$el
.
attr
(
'minlength'
)
||
0
,
max
=
$el
.
attr
(
'maxlength'
)
||
false
,
max
=
$el
.
attr
(
'maxlength'
)
||
false
,
...
@@ -35,7 +40,12 @@ var edx = edx || {};
...
@@ -35,7 +40,12 @@ var edx = edx || {};
},
},
required
:
function
(
$el
)
{
required
:
function
(
$el
)
{
return
$el
.
attr
(
'required'
)
?
$el
.
val
()
:
true
;
if
(
$el
.
attr
(
"type"
)
===
"checkbox"
)
{
return
$el
.
attr
(
'required'
)
?
$el
.
prop
(
"checked"
)
:
true
;
}
else
{
return
$el
.
attr
(
'required'
)
?
$el
.
val
()
:
true
;
}
},
},
email
:
{
email
:
{
...
@@ -66,6 +76,6 @@ var edx = edx || {};
...
@@ -66,6 +76,6 @@ var edx = edx || {};
})();
})();
edx
.
utils
.
validate
=
utils
.
validate
edx
.
utils
.
validate
=
utils
.
validate
;
})(
jQuery
,
_
);
})(
jQuery
,
_
);
\ No newline at end of file
lms/djangoapps/student_account/urls.py
View file @
d6102373
...
@@ -6,6 +6,7 @@ urlpatterns = patterns(
...
@@ -6,6 +6,7 @@ urlpatterns = patterns(
'student_account.views'
,
'student_account.views'
,
url
(
r'^login/$'
,
'login_and_registration_form'
,
{
'initial_mode'
:
'login'
},
name
=
'account_login'
),
url
(
r'^login/$'
,
'login_and_registration_form'
,
{
'initial_mode'
:
'login'
},
name
=
'account_login'
),
url
(
r'^register/$'
,
'login_and_registration_form'
,
{
'initial_mode'
:
'register'
},
name
=
'account_register'
),
url
(
r'^register/$'
,
'login_and_registration_form'
,
{
'initial_mode'
:
'register'
},
name
=
'account_register'
),
url
(
r'^password$'
,
'password_change_request_handler'
,
name
=
'password_change_request'
),
)
)
if
settings
.
FEATURES
.
get
(
'ENABLE_NEW_DASHBOARD'
):
if
settings
.
FEATURES
.
get
(
'ENABLE_NEW_DASHBOARD'
):
...
@@ -14,5 +15,4 @@ if settings.FEATURES.get('ENABLE_NEW_DASHBOARD'):
...
@@ -14,5 +15,4 @@ if settings.FEATURES.get('ENABLE_NEW_DASHBOARD'):
url
(
r'^$'
,
'index'
,
name
=
'account_index'
),
url
(
r'^$'
,
'index'
,
name
=
'account_index'
),
url
(
r'^email$'
,
'email_change_request_handler'
,
name
=
'email_change_request'
),
url
(
r'^email$'
,
'email_change_request_handler'
,
name
=
'email_change_request'
),
url
(
r'^email/confirmation/(?P<key>[^/]*)$'
,
'email_change_confirmation_handler'
,
name
=
'email_change_confirm'
),
url
(
r'^email/confirmation/(?P<key>[^/]*)$'
,
'email_change_confirmation_handler'
,
name
=
'email_change_confirm'
),
url
(
r'^password$'
,
'password_change_request_handler'
,
name
=
'password_change_request'
),
)
)
lms/envs/common.py
View file @
d6102373
...
@@ -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'
:
Tru
e
,
'ENABLE_NEW_DASHBOARD'
:
Fals
e
,
}
}
# Ignore static asset files on import which match this pattern
# Ignore static asset files on import which match this pattern
...
@@ -1036,6 +1036,7 @@ student_account_js = [
...
@@ -1036,6 +1036,7 @@ student_account_js = [
'js/student_account/views/AccessView.js'
,
'js/student_account/views/AccessView.js'
,
'js/student_account/accessApp.js'
,
'js/student_account/accessApp.js'
,
]
]
student_profile_js
=
sorted
(
rooted_glob
(
PROJECT_ROOT
/
'static'
,
'js/student_profile/**/*.js'
))
student_profile_js
=
sorted
(
rooted_glob
(
PROJECT_ROOT
/
'static'
,
'js/student_profile/**/*.js'
))
PIPELINE_CSS
=
{
PIPELINE_CSS
=
{
...
...
lms/static/js/spec/main.js
View file @
d6102373
...
@@ -216,6 +216,7 @@
...
@@ -216,6 +216,7 @@
exports
:
'js/student_account/account'
,
exports
:
'js/student_account/account'
,
deps
:
[
'jquery'
,
'underscore'
,
'backbone'
,
'gettext'
,
'jquery.cookie'
]
deps
:
[
'jquery'
,
'underscore'
,
'backbone'
,
'gettext'
,
'jquery.cookie'
]
},
},
'js/student_profile/profile'
:
{
'js/student_profile/profile'
:
{
exports
:
'js/student_profile/profile'
,
exports
:
'js/student_profile/profile'
,
deps
:
[
'jquery'
,
'underscore'
,
'backbone'
,
'gettext'
,
'jquery.cookie'
]
deps
:
[
'jquery'
,
'underscore'
,
'backbone'
,
'gettext'
,
'jquery.cookie'
]
...
@@ -231,6 +232,7 @@
...
@@ -231,6 +232,7 @@
exports
:
'js/dashboard/donation'
,
exports
:
'js/dashboard/donation'
,
deps
:
[
'jquery'
,
'underscore'
,
'gettext'
]
deps
:
[
'jquery'
,
'underscore'
,
'gettext'
]
},
},
// Backbone classes loaded explicitly until they are converted to use RequireJS
// Backbone classes loaded explicitly until they are converted to use RequireJS
'js/models/cohort'
:
{
'js/models/cohort'
:
{
exports
:
'CohortModel'
,
exports
:
'CohortModel'
,
...
@@ -257,7 +259,42 @@
...
@@ -257,7 +259,42 @@
'js/views/notification'
:
{
'js/views/notification'
:
{
exports
:
'NotificationView'
,
exports
:
'NotificationView'
,
deps
:
[
'backbone'
,
'jquery'
,
'underscore'
]
deps
:
[
'backbone'
,
'jquery'
,
'underscore'
]
}
},
// Student account registration/login
// Loaded explicitly until these are converted to RequireJS
'js/student_account/models/LoginModel'
:
{
exports
:
'js/student_account/models/LoginModel'
,
deps
:
[
'jquery'
,
'underscore'
,
'backbone'
,
'gettext'
,
'jquery.cookie'
]
},
'js/student_account/views/LoginView'
:
{
exports
:
'js/student_account/views/LoginView'
,
deps
:
[
'js/student_account/models/LoginModel'
]
},
'js/student_account/models/PasswordResetModel'
:
{
exports
:
'js/student_account/models/PasswordResetModel'
,
deps
:
[
'jquery'
,
'underscore'
,
'backbone'
,
'gettext'
,
'jquery.cookie'
]
},
'js/student_account/views/PasswordResetView'
:
{
exports
:
'js/student_account/views/PasswordResetView'
,
deps
:
[
'js/student_account/models/PasswordResetModel'
]
},
'js/student_account/models/RegisterModel'
:
{
exports
:
'js/student_account/models/RegisterModel'
,
deps
:
[
'jquery'
,
'underscore'
,
'backbone'
,
'gettext'
,
'jquery.cookie'
]
},
'js/student_account/views/RegisterView'
:
{
exports
:
'js/student_account/views/RegisterView'
,
deps
:
[
'js/student_account/models/RegisterModel'
]
},
'js/student_account/views/AccessView'
:
{
exports
:
'js/student_account/views/AccessView'
,
deps
:
[
'js/student_account/views/LoginView'
,
'js/student_account/views/PasswordResetView'
,
'js/student_account/views/RegisterView'
]
},
},
},
});
});
...
@@ -270,7 +307,11 @@
...
@@ -270,7 +307,11 @@
'lms/include/js/spec/views/notification_spec.js'
,
'lms/include/js/spec/views/notification_spec.js'
,
'lms/include/js/spec/dashboard/donation.js'
,
'lms/include/js/spec/dashboard/donation.js'
,
'lms/include/js/spec/student_account/account.js'
,
'lms/include/js/spec/student_account/account.js'
,
'lms/include/js/spec/student_profile/profile.js'
'lms/include/js/spec/student_account/access_spec.js'
,
'lms/include/js/spec/student_account/login_spec.js'
,
'lms/include/js/spec/student_account/register_spec.js'
,
'lms/include/js/spec/student_account/password_reset_spec.js'
,
'lms/include/js/spec/student_profile/profile.js'
,
]);
]);
}).
call
(
this
,
requirejs
,
define
);
}).
call
(
this
,
requirejs
,
define
);
lms/static/js/spec/student_account/access_spec.js
0 → 100644
View file @
d6102373
define
([
'js/student_account/views/AccessView'
],
function
()
{
'use strict'
;
describe
(
"edx.student.account.AccessView"
,
function
()
{
it
(
"initially displays the correct form"
,
function
()
{
// TODO
});
it
(
"toggles between the login and registration forms"
,
function
()
{
// TODO
});
it
(
"displays the reset password form"
,
function
()
{
// TODO
});
});
}
);
\ No newline at end of file
lms/static/js/spec/student_account/login_spec.js
0 → 100644
View file @
d6102373
define
([
'js/student_account/views/LoginView'
],
function
()
{
'use strict'
;
describe
(
"edx.student.account.LoginView"
,
function
()
{
it
(
"logs the user in"
,
function
()
{
// TODO
});
it
(
"displays third party auth login buttons"
,
function
()
{
// TODO
});
it
(
"validates the email field"
,
function
()
{
// TODO
});
it
(
"validates the password field"
,
function
()
{
// TODO
});
it
(
"displays login errors"
,
function
()
{
// TODO
});
it
(
"displays an error if the form definition could not be loaded"
,
function
()
{
// TODO
});
it
(
"displays an error if the server could not be contacted while logging in"
,
function
()
{
// TODO
});
it
(
"allows the user to navigate to the password assistance form"
,
function
()
{
// TODO
});
});
}
);
\ No newline at end of file
lms/static/js/spec/student_account/password_reset_spec.js
0 → 100644
View file @
d6102373
define
([
'js/student_account/views/PasswordResetView'
],
function
()
{
'use strict'
;
describe
(
"edx.student.account.PasswordResetView"
,
function
()
{
it
(
"allows the user to request a new password"
,
function
()
{
// TODO
});
it
(
"validates the email field"
,
function
()
{
// TODO
});
it
(
"displays password reset errors"
,
function
()
{
// TODO
});
it
(
"displays an error if the server could not be contacted"
,
function
()
{
// TODO
});
});
}
);
\ No newline at end of file
lms/static/js/spec/student_account/register_spec.js
0 → 100644
View file @
d6102373
define
([
'js/student_account/views/RegisterView'
],
function
()
{
'use strict'
;
describe
(
"edx.student.account.RegisterView"
,
function
()
{
it
(
"registers a new user"
,
function
()
{
// TODO
});
it
(
"displays third party auth registration buttons"
,
function
()
{
// TODO
});
it
(
"validates form fields"
,
function
()
{
// TODO
});
it
(
"displays registration errors"
,
function
()
{
// TODO
});
it
(
"displays an error if the form definition could not be loaded"
,
function
()
{
// TODO
});
it
(
"displays an error if the server could not be contacted while registering"
,
function
()
{
// TODO
});
});
}
);
\ No newline at end of file
lms/templates/student_account/login.underscore
View file @
d6102373
...
@@ -7,6 +7,4 @@
...
@@ -7,6 +7,4 @@
</div>
</div>
<%= fields %>
<%= fields %>
<button class="action action-primary action-update js-login">Log in</button>
<button class="action action-primary action-update js-login">Log in</button>
<button type="submit" class="button button-primary button-facebook"><span class="icon icon-facebook"></span>Sign in with Facebook</button>
<button type="submit" class="button button-primary button-google"><span class="icon icon-google-plus"></span>Sign in with Google</button>
</form>
</form>
\ No newline at end of file
lms/templates/student_account/register.underscore
View file @
d6102373
...
@@ -5,11 +5,6 @@
...
@@ -5,11 +5,6 @@
<p>Please enter a valid password</p>
<p>Please enter a valid password</p>
</div>
</div>
</div>
</div>
<button type="submit" class="button button-primary button-facebook"><span class="icon icon-facebook"></span>Sign up with Facebook</button>
<button type="submit" class="button button-primary button-google"><span class="icon icon-google-plus"></span>Sign up with Google</button>
<%= fields %>
<%= fields %>
<input id="register-termsofservice" type="checkbox" name="termsofservice">
<label for="register-termsofservice">I agree to the <a href="#">Terms of Service and Honor Code</a> *</label>
<button class="action action-primary action-update js-register">Create My edX Account</button>
<button class="action action-primary action-update js-register">Create My edX Account</button>
</form>
</form>
\ No newline at end of file
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