From ed39ca2303a5d0bb0e63e53d5958d527fccac755 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Thu, 17 Jan 2013 09:59:17 -0500 Subject: [PATCH 001/388] initial branch creation for reg/login revisions with drupal --- lms/templates/login.html | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lms/templates/login.html diff --git a/lms/templates/login.html b/lms/templates/login.html new file mode 100644 index 0000000000..22cfc2aa68 --- /dev/null +++ b/lms/templates/login.html @@ -0,0 +1,10 @@ +<%inherit file="main.html" /> + +<%namespace name='static' file='static_content.html'/> + +<%block name="title">Login + + + +
+
From 9af7c6cc5d3e26e8b62cb0c39fe1ff9cb230b3db Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Thu, 17 Jan 2013 11:52:58 -0500 Subject: [PATCH 002/388] adding login views --- common/djangoapps/student/views.py | 27 ++++++++++++++++++--------- lms/templates/login.html | 8 ++------ lms/templates/register.html | 7 +++++++ lms/urls.py | 2 ++ 4 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 lms/templates/register.html diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 61b49e6022..071a41a834 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -203,6 +203,22 @@ def _cert_info(user, course, cert_status): return d + +def login(request): + """ + This view will display the non-modal login form + """ + context = {} + return render_to_response('login.html', context) + +def register(request): + """ + This view will display the non-modal registration form + """ + context = {} + return render_to_response('register.html', context) + + @login_required @ensure_csrf_cookie def dashboard(request): @@ -675,18 +691,11 @@ def create_exam_registration(request, post_override=None): username = post_vars['username'] user = User.objects.get(username=username) course_id = post_vars['course_id'] - course = course_from_id(course_id) # assume it will be found.... - - # make sure that any demographic data values received from the page have been stripped. - # Whitespace is not an acceptable response for any of these values - demographic_data = {} - for fieldname in TestCenterUser.user_provided_fields(): - if fieldname in post_vars: - demographic_data[fieldname] = (post_vars[fieldname]).strip() + course = (course_from_id(course_id)) # assume it will be found.... try: testcenter_user = TestCenterUser.objects.get(user=user) - needs_updating = testcenter_user.needs_update(demographic_data) + needs_updating = testcenter_user.needs_update(post_vars) log.info("User {0} enrolled in course {1} {2}updating demographic info for exam registration".format(user.username, course_id, "" if needs_updating else "not ")) except TestCenterUser.DoesNotExist: # do additional initialization here: diff --git a/lms/templates/login.html b/lms/templates/login.html index 22cfc2aa68..3fa28b9f72 100644 --- a/lms/templates/login.html +++ b/lms/templates/login.html @@ -1,10 +1,6 @@ <%inherit file="main.html" /> <%namespace name='static' file='static_content.html'/> +<%block name="title">login -<%block name="title">Login - - - - +Hello world diff --git a/lms/templates/register.html b/lms/templates/register.html new file mode 100644 index 0000000000..82be5db85d --- /dev/null +++ b/lms/templates/register.html @@ -0,0 +1,7 @@ +<%inherit file="main.html" /> + +<%namespace name='static' file='static_content.html'/> +<%block name="title">register + +Hello world + diff --git a/lms/urls.py b/lms/urls.py index ad3b324534..39beeda61d 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -15,6 +15,8 @@ urlpatterns = ('', url(r'^update_certificate$', 'certificates.views.update_certificate'), url(r'^$', 'branding.views.index', name="root"), # Main marketing page, or redirect to courseware url(r'^dashboard$', 'student.views.dashboard', name="dashboard"), + url(r'^login$', 'student.views.login', name="login"), + url(r'^register$', 'student.views.register', name="register"), url(r'^admin_dashboard$', 'dashboard.views.dashboard'), From 2c604bc4730bc947b0fbb14a6c7acbaa2efffc90 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Thu, 17 Jan 2013 16:13:02 -0500 Subject: [PATCH 003/388] changing url name to signin --- lms/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/urls.py b/lms/urls.py index 39beeda61d..fa39c56cef 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -15,7 +15,7 @@ urlpatterns = ('', url(r'^update_certificate$', 'certificates.views.update_certificate'), url(r'^$', 'branding.views.index', name="root"), # Main marketing page, or redirect to courseware url(r'^dashboard$', 'student.views.dashboard', name="dashboard"), - url(r'^login$', 'student.views.login', name="login"), + url(r'^signin$', 'student.views.login', name="login"), url(r'^register$', 'student.views.register', name="register"), url(r'^admin_dashboard$', 'dashboard.views.dashboard'), From 1db87e053348dbdfbd1040f35053964e69bb4d34 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Sun, 20 Jan 2013 15:08:50 -0500 Subject: [PATCH 004/388] drupal integration - added sass files to architecture and plumbed HTML for login and register views --- lms/static/sass/application.scss | 2 + lms/static/sass/multicourse/_login.scss | 0 lms/static/sass/multicourse/_register.scss | 0 lms/templates/login.html | 123 ++++++++++++- lms/templates/register.html | 199 ++++++++++++++++++++- 5 files changed, 320 insertions(+), 4 deletions(-) create mode 100644 lms/static/sass/multicourse/_login.scss create mode 100644 lms/static/sass/multicourse/_register.scss diff --git a/lms/static/sass/application.scss b/lms/static/sass/application.scss index d1dd3d1d4e..273299f6f9 100644 --- a/lms/static/sass/application.scss +++ b/lms/static/sass/application.scss @@ -29,6 +29,8 @@ @import 'multicourse/password_reset'; @import 'multicourse/error-pages'; @import 'multicourse/help'; +@import 'multicourse/login'; +@import 'multicourse/register'; @import 'discussion'; @import 'news'; diff --git a/lms/static/sass/multicourse/_login.scss b/lms/static/sass/multicourse/_login.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lms/static/sass/multicourse/_register.scss b/lms/static/sass/multicourse/_register.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lms/templates/login.html b/lms/templates/login.html index 3fa28b9f72..fe46f54cb4 100644 --- a/lms/templates/login.html +++ b/lms/templates/login.html @@ -1,6 +1,125 @@ <%inherit file="main.html" /> <%namespace name='static' file='static_content.html'/> -<%block name="title">login +<%block name="title">Log into your edX Account -Hello world +<%block name="js_extra"> + + + + diff --git a/lms/templates/register.html b/lms/templates/register.html index 82be5db85d..6bfe92b67e 100644 --- a/lms/templates/register.html +++ b/lms/templates/register.html @@ -1,7 +1,202 @@ <%inherit file="main.html" /> <%namespace name='static' file='static_content.html'/> -<%block name="title">register +<%! from django.core.urlresolvers import reverse %> +<%! from django_countries.countries import COUNTRIES %> +<%! from student.models import UserProfile %> +<%! from datetime import date %> +<%! import calendar %> -Hello world +<%block name="title">Register for edX +<%block name="js_extra"> + + + +
+
+
+

Register for edX

+
+
+ +
+
+ +
+ +
+ + + + + + +

+ Please complete the following fields to register for an edX account. Required fields are noted by bold text and an asterisk (*). +

+ +
+ + + % if has_extauth_info is UNDEFINED: + +
    +
  1. + + +
  2. +
  3. + + +
  4. +
  5. + + + Will be shown in any discussions or forums you participate in +
  6. +
  7. + + + Needed for any certificates you earn +
  8. +
+ + % else: + +
+

Welcome ${extauth_email}

+

Enter a public username:

+
+ +
    +
  1. + + + Will be shown in any discussions or forums you participate in +
  2. +
+ + % endif +
+ +
+ + +
    +
  1. + + +
  2. + +
  3. + + +
  4. + +
  5. + + +
  6. +
+
+ +
+ + +
    +
  1. + + +
  2. + +
  3. + + +
  4. +
+
+ +
+ + +
    +
  1. + + +
  2. + +
  3. + + +
  4. +
+
+ +
+ + % if has_extauth_info is UNDEFINED: + + % endif +
+
+
+ + +
\ No newline at end of file From 6bff41708d6f773bf51ad03a40dd908dd71a28e2 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Mon, 21 Jan 2013 12:53:27 -0500 Subject: [PATCH 005/388] cleaning up LMS Sass variables a bit --- lms/static/sass/base/_variables.scss | 28 +++++++++---------- .../multicourse/_testcenter-register.scss | 8 ------ 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/lms/static/sass/base/_variables.scss b/lms/static/sass/base/_variables.scss index 8d1b78a0eb..36bf31d4df 100644 --- a/lms/static/sass/base/_variables.scss +++ b/lms/static/sass/base/_variables.scss @@ -1,6 +1,7 @@ +$baseline: 20px; + $gw-column: 80px; $gw-gutter: 20px; - $fg-column: $gw-column; $fg-gutter: $gw-gutter; $fg-max-columns: 12; @@ -8,25 +9,24 @@ $fg-max-width: 1400px; $fg-min-width: 810px; $sans-serif: 'Open Sans', $verdana; -$body-font-family: $sans-serif; -$serif: $georgia; $monospace: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; - -$body-font-size: em(14); -$body-line-height: golden-ratio(.875em, 1); -$base-font-color: rgb(60,60,60); -$lighter-base-font-color: rgb(100,100,100); +$serif: $georgia; $blue: rgb(29,157,217); $pink: rgb(182,37,104); $yellow: rgb(255, 252, 221); +$red: rgb(178, 6, 16); $error-red: rgb(253, 87, 87); -$border-color: #C8C8C8; -$sidebar-color: #f6f6f6; -$outer-border-color: #aaa; +$light-gray: rgb(221, 221, 221); +$dark-gray: rgb(51, 51, 51); +$border-color: rgb(200, 200, 200); +$sidebar-color: rgb(246, 246, 246); +$outer-border-color: rgb(170, 170, 170); -// old variables -$light-gray: #ddd; -$dark-gray: #333; +$base-font-color: rgb(60,60,60); +$lighter-base-font-color: rgb(100,100,100); $text-color: $dark-gray; +$body-font-family: $sans-serif; +$body-font-size: em(14); +$body-line-height: golden-ratio(.875em, 1); \ No newline at end of file diff --git a/lms/static/sass/multicourse/_testcenter-register.scss b/lms/static/sass/multicourse/_testcenter-register.scss index 6d85fc167f..77b4788823 100644 --- a/lms/static/sass/multicourse/_testcenter-register.scss +++ b/lms/static/sass/multicourse/_testcenter-register.scss @@ -1,11 +1,3 @@ -// ========== - -$baseline: 20px; -$yellow: rgb(255, 235, 169); -$red: rgb(178, 6, 16); - -// ========== - .testcenter-register { @include clearfix; padding: 60px 0px 120px; From 7c7d0da5b4f5009dcad333ed1bc9e62545592d74 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Mon, 21 Jan 2013 15:50:16 -0500 Subject: [PATCH 006/388] drupal integration - styled page layout, form fields and states, added in status message areas/standards and revised Sass --- lms/static/sass/application.scss | 6 +- lms/static/sass/base/_variables.scss | 9 ++ lms/static/sass/multicourse/_login.scss | 0 lms/static/sass/multicourse/_register.scss | 0 .../multicourse/_testcenter-register.scss | 3 + lms/templates/login.html | 43 +++--- lms/templates/register.html | 131 ++++++++++-------- 7 files changed, 113 insertions(+), 79 deletions(-) delete mode 100644 lms/static/sass/multicourse/_login.scss delete mode 100644 lms/static/sass/multicourse/_register.scss diff --git a/lms/static/sass/application.scss b/lms/static/sass/application.scss index 273299f6f9..285d98fdcb 100644 --- a/lms/static/sass/application.scss +++ b/lms/static/sass/application.scss @@ -16,10 +16,9 @@ @import 'shared/course_filter'; @import 'shared/modal'; @import 'shared/activation_messages'; - @import 'multicourse/home'; @import 'multicourse/dashboard'; -@import 'multicourse/testcenter-register'; +@import 'multicourse/account'; @import 'multicourse/courses'; @import 'multicourse/course_about'; @import 'multicourse/jobs'; @@ -29,8 +28,7 @@ @import 'multicourse/password_reset'; @import 'multicourse/error-pages'; @import 'multicourse/help'; -@import 'multicourse/login'; -@import 'multicourse/register'; +@import 'multicourse/testcenter-register'; @import 'discussion'; @import 'news'; diff --git a/lms/static/sass/base/_variables.scss b/lms/static/sass/base/_variables.scss index 36bf31d4df..c2e4fad344 100644 --- a/lms/static/sass/base/_variables.scss +++ b/lms/static/sass/base/_variables.scss @@ -12,6 +12,8 @@ $sans-serif: 'Open Sans', $verdana; $monospace: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; $serif: $georgia; +$white: rgb(255,255,255); +$black: rgb(0,0,0); $blue: rgb(29,157,217); $pink: rgb(182,37,104); $yellow: rgb(255, 252, 221); @@ -23,6 +25,13 @@ $border-color: rgb(200, 200, 200); $sidebar-color: rgb(246, 246, 246); $outer-border-color: rgb(170, 170, 170); +// edx.org-related +$m-gray-l: rgb(247, 247, 247); +$m-gray: rgb(67,67,67); +$m-blue: rgb(2,159,211); +$m-base-font-size: em(16); + + $base-font-color: rgb(60,60,60); $lighter-base-font-color: rgb(100,100,100); $text-color: $dark-gray; diff --git a/lms/static/sass/multicourse/_login.scss b/lms/static/sass/multicourse/_login.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lms/static/sass/multicourse/_register.scss b/lms/static/sass/multicourse/_register.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lms/static/sass/multicourse/_testcenter-register.scss b/lms/static/sass/multicourse/_testcenter-register.scss index 77b4788823..01405d7fc1 100644 --- a/lms/static/sass/multicourse/_testcenter-register.scss +++ b/lms/static/sass/multicourse/_testcenter-register.scss @@ -1,3 +1,6 @@ +// Pearson VUE Test Center Registration +// ===== + .testcenter-register { @include clearfix; padding: 60px 0px 120px; diff --git a/lms/templates/login.html b/lms/templates/login.html index fe46f54cb4..56ac86c8eb 100644 --- a/lms/templates/login.html +++ b/lms/templates/login.html @@ -7,8 +7,10 @@ + +
+
-

Enter new password

-
+

Reset Your edX Password

+
-

Please enter your new password twice so we can verify you typed it in correctly.

+
+ {% if validlink %} +
+ +
+ +
+ + - {% csrf_token %} - {{ form.new_password1.errors }} - - {{ form.new_password1 }} + - {{ form.new_password2.errors }} - - {{ form.new_password2 }} + -
- +

+ Please enter your new password twice so we can verify you typed it in correctly.
+ Required fields are noted by bold text and an asterisk (*). +

+ +
+ + +
    +
  1. + + +
  2. +
  3. + + +
  4. +
+
+ +
+
{% else %}
-

Password reset unsuccessful

-
+
- -

The password reset link was invalid, possibly because the link has already been used. Please request a new password reset.

+

The password reset link was invalid, possibly because the link has already been used. Please request a new password reset.

{% endif %} -
- {% endblock %} - - + +
\ No newline at end of file From c500896913a467ebbe72366fd51f4e8d43fc15d7 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Tue, 22 Jan 2013 11:40:58 -0500 Subject: [PATCH 015/388] drupal integration - adding back in modal assets for passwor recovery - wip --- lms/templates/navigation.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lms/templates/navigation.html b/lms/templates/navigation.html index 8b7831becf..da777e4531 100644 --- a/lms/templates/navigation.html +++ b/lms/templates/navigation.html @@ -100,4 +100,8 @@ site_status_msg = get_site_status_msg(course_id) % if course:
Warning: Your browser is not fully supported. We strongly recommend using Chrome or Firefox.
-% endif \ No newline at end of file +% endif + +%if not user.is_authenticated(): + <%include file="forgot_password_modal.html" /> +%endif \ No newline at end of file From 633126234ed352fc4d71cff04dbe51fd6b2ee3b1 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Tue, 22 Jan 2013 11:58:04 -0500 Subject: [PATCH 016/388] drupal integration - adding back in modal assets for password recovery - wip --- lms/templates/login.html | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lms/templates/login.html b/lms/templates/login.html index e386769dac..5fb08f4221 100644 --- a/lms/templates/login.html +++ b/lms/templates/login.html @@ -75,7 +75,9 @@
  • - Forgot password? + + Forgot password? +
  • @@ -115,11 +117,6 @@ --> % endif -
    -

    Forgot Your edX Password

    -

    Request help with resetting your password

    -
    -

    Need Help?

    Looking for help in logging in or with your edX account? View our help section for contact information and answers to commonly asked questions

    From a15bf74f7caa3223c8e15143712cb8418ba3c36c Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Tue, 22 Jan 2013 14:02:03 -0500 Subject: [PATCH 017/388] drupal integration - styled and revised markup/copy for password reset modal --- lms/static/sass/multicourse/_account.scss | 83 ++++++++++++++++++++++- lms/templates/forgot_password_modal.html | 25 ++++--- 2 files changed, 99 insertions(+), 9 deletions(-) diff --git a/lms/static/sass/multicourse/_account.scss b/lms/static/sass/multicourse/_account.scss index 3a474aba66..9f17c5b0c9 100644 --- a/lms/static/sass/multicourse/_account.scss +++ b/lms/static/sass/multicourse/_account.scss @@ -24,7 +24,7 @@ } // shared -.login, .register, .passwordreset { +.login, .register, .passwordreset, #forgot-password-modal #password-reset { padding: ($baseline*1.5); @include clearfix; @@ -183,6 +183,7 @@ input, textarea { width: 100%; + font-weight: 600; } } @@ -427,4 +428,84 @@ // password reset .passwordreset { +} + +// modal password reset form +#forgot-password-modal { + @include border-radius(2px); + + + .inner-wrapper { + @include border-radius(2px); + background: $m-gray-l; + padding-bottom: 0 !important; + } + + #password-reset { + + header { + border-bottom: 1px solid tint($m-gray,70%); + background-image: none; + padding: 0; + + &:before { + background-image: none; + } + + h2 { + font-size: em(24); + font-weight: 700; + text-transform: none; + } + } + + .instructions { + + p { + color: $m-gray; + font-size: em(14); + } + } + + fieldset { + padding: 0 !important; + margin: ($baseline*1.25) 0 !important; + } + + form { + @include border-radius(0); + @include box-shadow(none); + margin: $baseline 0; + border: none; + padding: 0; + + .field { + + &.text, &.email, &.textarea { + + input { + background: #fafafa; + margin-bottom: 0; + } + } + } + + .form-actions { + padding: 0 !important; + + .action-primary { + float: none; + display: block !important; + width: 100%; + } + } + } + } + + .modal-form-error { + @include border-radius(2px); + border: 1px solid tint($red,65%); + background: tint($red,98%); + color: $red; + } } \ No newline at end of file diff --git a/lms/templates/forgot_password_modal.html b/lms/templates/forgot_password_modal.html index 97b41d4be9..4383874632 100644 --- a/lms/templates/forgot_password_modal.html +++ b/lms/templates/forgot_password_modal.html @@ -3,19 +3,28 @@
    -

    Password reset

    -
    +

    Password Reset

    -
    -

    Enter your e-mail address below, and we will e-mail instructions for setting a new password.

    +
    +

    Please enter your e-mail address below, and we will e-mail instructions for setting a new password.

    - - -
    - +
    + + +
      +
    1. + + + This is the email address you used to register with edX +
    2. +
    +
    + +
    +
    From bb66f8963f13cd1858d1a3a5053ce67c6143548f Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Tue, 22 Jan 2013 14:09:32 -0500 Subject: [PATCH 018/388] drupal integration - revised general page background for shorter content pages, small visual tweaks to footer --- lms/static/sass/base/_base.scss | 2 +- lms/static/sass/multicourse/_account.scss | 1 + lms/static/sass/shared/_footer.scss | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lms/static/sass/base/_base.scss b/lms/static/sass/base/_base.scss index 9663bc0589..43b4a61114 100644 --- a/lms/static/sass/base/_base.scss +++ b/lms/static/sass/base/_base.scss @@ -1,4 +1,4 @@ -html, body { +body { background: rgb(250,250,250); font-family: $sans-serif; font-size: 1em; diff --git a/lms/static/sass/multicourse/_account.scss b/lms/static/sass/multicourse/_account.scss index 9f17c5b0c9..82117b21ae 100644 --- a/lms/static/sass/multicourse/_account.scss +++ b/lms/static/sass/multicourse/_account.scss @@ -3,6 +3,7 @@ // page-level .view-register, .view-login, .view-passwordreset { + background: $white; .content-wrapper { background: $m-gray-l; diff --git a/lms/static/sass/shared/_footer.scss b/lms/static/sass/shared/_footer.scss index 7702d4d542..62b0a25b40 100644 --- a/lms/static/sass/shared/_footer.scss +++ b/lms/static/sass/shared/_footer.scss @@ -1,4 +1,5 @@ .wrapper-footer { + @include box-shadow(0 -1px 5px 0 rgba(0,0,0, 0.1)); border-top: 1px solid tint($m-gray,50%); padding: 25px ($baseline/2) ($baseline*1.5) ($baseline/2); background: $white; From e1fae8e885ee16d741dc8c1fb3c065898cf4579e Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Tue, 22 Jan 2013 14:31:08 -0500 Subject: [PATCH 019/388] drupal integration - color syncing with marketing site standards --- lms/static/sass/base/_variables.scss | 3 ++- lms/static/sass/multicourse/_account.scss | 10 +++++----- lms/static/sass/shared/_footer.scss | 6 +++--- lms/static/sass/shared/_header.scss | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lms/static/sass/base/_variables.scss b/lms/static/sass/base/_variables.scss index c2e4fad344..83b3109f28 100644 --- a/lms/static/sass/base/_variables.scss +++ b/lms/static/sass/base/_variables.scss @@ -28,7 +28,8 @@ $outer-border-color: rgb(170, 170, 170); // edx.org-related $m-gray-l: rgb(247, 247, 247); $m-gray: rgb(67,67,67); -$m-blue: rgb(2,159,211); +$m-blue: rgb(23,135,183); +$m-blue-s: rgb(2,159,211); $m-base-font-size: em(16); diff --git a/lms/static/sass/multicourse/_account.scss b/lms/static/sass/multicourse/_account.scss index 82117b21ae..6342c78f88 100644 --- a/lms/static/sass/multicourse/_account.scss +++ b/lms/static/sass/multicourse/_account.scss @@ -49,8 +49,8 @@ } &:hover, &:active { - border-bottom: 1px dotted shade($m-blue, 20%); - color: shade($m-blue, 20%); + border-bottom: 1px dotted $m-blue-s; + color: $m-blue-s; } } @@ -285,11 +285,11 @@ &.is-focused { label { - color: $m-blue; + color: $m-blue-s; } .tip { - color: tint($m-blue, 30%); + color: $m-blue-s; } } @@ -335,7 +335,7 @@ @include clearfix(); button[type="submit"] { - @include button(simple, $blue); + @include button(simple, $m-blue-s); @include box-sizing(border-box); @include border-radius(3px); padding: ($baseline*0.75) $baseline; diff --git a/lms/static/sass/shared/_footer.scss b/lms/static/sass/shared/_footer.scss index 62b0a25b40..72fd3c00ce 100644 --- a/lms/static/sass/shared/_footer.scss +++ b/lms/static/sass/shared/_footer.scss @@ -25,8 +25,8 @@ } &:hover, &:active { - border-bottom: 1px dotted shade($m-blue, 20%); - color: shade($m-blue, 20%); + border-bottom: 1px dotted $m-blue-s; + color: $m-blue-s; } } @@ -48,7 +48,7 @@ color: tint($black, 20%); &:hover, &:active { - color: shade($m-blue, 20%); + color: $m-blue-s; } } diff --git a/lms/static/sass/shared/_header.scss b/lms/static/sass/shared/_header.scss index b676270261..5e5f51f5a4 100644 --- a/lms/static/sass/shared/_header.scss +++ b/lms/static/sass/shared/_header.scss @@ -275,7 +275,7 @@ header.global { &:hover, &:active { text-decoration: none; - color: $m-blue; + color: $m-blue-s; } } } @@ -295,7 +295,7 @@ header.global { display: inline-block; a { - @include button(simple, $blue); + @include button(simple, $m-blue); @include box-sizing(border-box); @include border-radius(3px); padding: ($baseline/4) ($baseline/2); From cbe35eeab365a389ef0e90b590f7ebcef70ac4a7 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Tue, 22 Jan 2013 14:38:31 -0500 Subject: [PATCH 020/388] drupal integration - further color sync, copy edits, and removing courseware button when on login page --- lms/static/sass/base/_variables.scss | 2 +- lms/static/sass/multicourse/_account.scss | 10 +++++++--- lms/templates/login.html | 4 ++-- lms/templates/register.html | 17 ++++++----------- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/lms/static/sass/base/_variables.scss b/lms/static/sass/base/_variables.scss index 83b3109f28..ffda2fe140 100644 --- a/lms/static/sass/base/_variables.scss +++ b/lms/static/sass/base/_variables.scss @@ -28,7 +28,7 @@ $outer-border-color: rgb(170, 170, 170); // edx.org-related $m-gray-l: rgb(247, 247, 247); $m-gray: rgb(67,67,67); -$m-blue: rgb(23,135,183); +$m-blue: rgb(23,174,223); $m-blue-s: rgb(2,159,211); $m-base-font-size: em(16); diff --git a/lms/static/sass/multicourse/_account.scss b/lms/static/sass/multicourse/_account.scss index 6342c78f88..7de570b7eb 100644 --- a/lms/static/sass/multicourse/_account.scss +++ b/lms/static/sass/multicourse/_account.scss @@ -409,7 +409,11 @@ // ===== // login -.login { +.view-login { + + .nav-courseware .cta-login { + display: none; + } .group-form-accountpreferences { padding-top: 0; @@ -418,7 +422,7 @@ } // register -.register { +.view-register { .group-form-accountacknowledgements { padding-top: 0; @@ -427,7 +431,7 @@ } // password reset -.passwordreset { +.view-passwordreset { } diff --git a/lms/templates/login.html b/lms/templates/login.html index 5fb08f4221..e4fb0d4470 100644 --- a/lms/templates/login.html +++ b/lms/templates/login.html @@ -96,9 +96,9 @@
    % if has_extauth_info is UNDEFINED: - + % endif
    diff --git a/lms/templates/register.html b/lms/templates/register.html index 7718edc487..b84bd4a33d 100644 --- a/lms/templates/register.html +++ b/lms/templates/register.html @@ -105,7 +105,7 @@
  • - Needed for any certificates you earn + Needed for any certificates you may earn
  • @@ -186,14 +186,9 @@
    1. -
      - - -
      - -
      - - +
      + +
    @@ -202,9 +197,9 @@
    % if has_extauth_info is UNDEFINED: - + % endif
    From 837453480259cf41626cbd5f34736e6baad17d66 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Tue, 22 Jan 2013 23:05:14 -0500 Subject: [PATCH 021/388] drupal integration - revised copy, layout, and styles per marketing feedback --- lms/static/sass/multicourse/_account.scss | 17 ++++++--- lms/static/sass/shared/_header.scss | 23 +++++++++++++ lms/templates/forgot_password_modal.html | 2 +- lms/templates/login.html | 13 +++---- lms/templates/navigation.html | 9 ++--- lms/templates/register.html | 42 ++++++++++++++--------- 6 files changed, 69 insertions(+), 37 deletions(-) diff --git a/lms/static/sass/multicourse/_account.scss b/lms/static/sass/multicourse/_account.scss index 7de570b7eb..c2be97c9bd 100644 --- a/lms/static/sass/multicourse/_account.scss +++ b/lms/static/sass/multicourse/_account.scss @@ -106,6 +106,17 @@ margin-top: $baseline; font-size: em(14); text-align: right; + + .action { + @include button(simple, $m-gray-l); + @include box-sizing(border-box); + @include border-radius(3px); + padding: ($baseline/4) ($baseline/2); + font-size: em(16); + font-weight: 700; + letter-spacing: 0; + text-align: center; + } } } } @@ -351,7 +362,7 @@ .action-primary { float: left; - width: flex-grid(5,8); + width: flex-grid(8,8); margin-right: flex-gutter(0); } @@ -411,10 +422,6 @@ // login .view-login { - .nav-courseware .cta-login { - display: none; - } - .group-form-accountpreferences { padding-top: 0; padding-bottom: 0; diff --git a/lms/static/sass/shared/_header.scss b/lms/static/sass/shared/_header.scss index 5e5f51f5a4..852c7d0ae0 100644 --- a/lms/static/sass/shared/_header.scss +++ b/lms/static/sass/shared/_header.scss @@ -278,6 +278,14 @@ header.global { color: $m-blue-s; } } + + &.active { + + a { + text-decoration: none; + color: $m-blue-s; + } + } } // logged in @@ -316,4 +324,19 @@ header.global { } } + + +// ===== + +// page-based nav states + .view-howitworks .nav-global-01, + .view-courses .nav-global-02, + .view-schools .nav-global-03, + .view-register .nav-global-04 { + + a { + text-decoration: none; + color: $m-blue-s !important; + } + } } \ No newline at end of file diff --git a/lms/templates/forgot_password_modal.html b/lms/templates/forgot_password_modal.html index 4383874632..17ec46413c 100644 --- a/lms/templates/forgot_password_modal.html +++ b/lms/templates/forgot_password_modal.html @@ -17,7 +17,7 @@
    1. - + This is the email address you used to register with edX
    diff --git a/lms/templates/login.html b/lms/templates/login.html index e4fb0d4470..646ad1fa6f 100644 --- a/lms/templates/login.html +++ b/lms/templates/login.html @@ -70,11 +70,11 @@
    1. - +
    2. - + Forgot password? @@ -94,12 +94,7 @@
      - - % if has_extauth_info is UNDEFINED: - - Not enrolled? Register - - % endif +
      @@ -119,7 +114,7 @@

      Need Help?

      -

      Looking for help in logging in or with your edX account? View our help section for contact information and answers to commonly asked questions

      +

      Looking for help in logging in or with your edX account? View our help section for answers to commonly asked questions

      diff --git a/lms/templates/navigation.html b/lms/templates/navigation.html index da777e4531..945a54124e 100644 --- a/lms/templates/navigation.html +++ b/lms/templates/navigation.html @@ -46,11 +46,8 @@ site_status_msg = get_site_status_msg(course_id) % if user.is_authenticated(): @@ -91,7 +88,7 @@ site_status_msg = get_site_status_msg(course_id) diff --git a/lms/templates/register.html b/lms/templates/register.html index b84bd4a33d..06d4f54acf 100644 --- a/lms/templates/register.html +++ b/lms/templates/register.html @@ -91,21 +91,21 @@
      1. - +
      2. - +
      3. - + Will be shown in any discussions or forums you participate in
      4. - - Needed for any certificates you may earn + + Needed for any certificates you may earn (cannot be changed later)
      @@ -119,7 +119,7 @@
      1. - + Will be shown in any discussions or forums you participate in
      @@ -175,7 +175,7 @@
    3. - +
    @@ -186,9 +186,14 @@
    1. -
      - - +
      + + +
      + +
      + +
    @@ -196,11 +201,6 @@
    - % if has_extauth_info is UNDEFINED: - - - - % endif
    @@ -210,9 +210,19 @@ +
    +

    Welcome to edX

    +

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis. [Matt to provide copy]

    +
    + +
    +

    What an edX Account Means

    +

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis. [Matt to provide copy]

    +
    +

    Need Help?

    -

    Looking for help in registering with edX? View our help section for contact information and answers to commonly asked questions

    +

    Looking for help in registering with edX? View our help section for answers to commonly asked questions

    \ No newline at end of file From 80bcf060a0a0bc8c3b6c893ca473ef60b78d4514 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Wed, 23 Jan 2013 17:52:15 -0500 Subject: [PATCH 022/388] javascript to redirect the user to the dashboard after reg --- lms/templates/register.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lms/templates/register.html b/lms/templates/register.html index 06d4f54acf..30d7f6a493 100644 --- a/lms/templates/register.html +++ b/lms/templates/register.html @@ -225,4 +225,20 @@

    Looking for help in registering with edX? View our help section for answers to commonly asked questions

    - \ No newline at end of file + + + + + From dcc53c2bcdf70e734cfe6065f5c8420fd3f9889e Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Wed, 23 Jan 2013 17:53:23 -0500 Subject: [PATCH 023/388] Fixing namespace issue for "login" * renaming login to login_user * renaming register to register_user --- common/djangoapps/student/views.py | 4 ++-- lms/urls.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 071a41a834..1f711e146a 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -204,14 +204,14 @@ def _cert_info(user, course, cert_status): return d -def login(request): +def login_user(request): """ This view will display the non-modal login form """ context = {} return render_to_response('login.html', context) -def register(request): +def register_user(request): """ This view will display the non-modal registration form """ diff --git a/lms/urls.py b/lms/urls.py index fa39c56cef..a2c02ef2de 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -15,8 +15,8 @@ urlpatterns = ('', url(r'^update_certificate$', 'certificates.views.update_certificate'), url(r'^$', 'branding.views.index', name="root"), # Main marketing page, or redirect to courseware url(r'^dashboard$', 'student.views.dashboard', name="dashboard"), - url(r'^signin$', 'student.views.login', name="login"), - url(r'^register$', 'student.views.register', name="register"), + url(r'^signin$', 'student.views.login_user', name="login_user"), + url(r'^register$', 'student.views.register_user', name="register_user"), url(r'^admin_dashboard$', 'dashboard.views.dashboard'), From 8a0cc6e610fa9e2da2e0e1dcc2c97fe8f54b0b57 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Wed, 23 Jan 2013 18:34:53 -0500 Subject: [PATCH 024/388] Revert "Fixing namespace issue for "login"" This reverts commit dcc53c2bcdf70e734cfe6065f5c8420fd3f9889e. --- common/djangoapps/student/views.py | 4 ++-- lms/urls.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 1f711e146a..071a41a834 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -204,14 +204,14 @@ def _cert_info(user, course, cert_status): return d -def login_user(request): +def login(request): """ This view will display the non-modal login form """ context = {} return render_to_response('login.html', context) -def register_user(request): +def register(request): """ This view will display the non-modal registration form """ diff --git a/lms/urls.py b/lms/urls.py index a2c02ef2de..fa39c56cef 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -15,8 +15,8 @@ urlpatterns = ('', url(r'^update_certificate$', 'certificates.views.update_certificate'), url(r'^$', 'branding.views.index', name="root"), # Main marketing page, or redirect to courseware url(r'^dashboard$', 'student.views.dashboard', name="dashboard"), - url(r'^signin$', 'student.views.login_user', name="login_user"), - url(r'^register$', 'student.views.register_user', name="register_user"), + url(r'^signin$', 'student.views.login', name="login"), + url(r'^register$', 'student.views.register', name="register"), url(r'^admin_dashboard$', 'dashboard.views.dashboard'), From 64f08550556a44eb75868168c6fcc8f0f1f49790 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Wed, 23 Jan 2013 18:41:17 -0500 Subject: [PATCH 025/388] Adding removed code from master rebase --- common/djangoapps/student/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 071a41a834..d9ead9c6fb 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -693,9 +693,15 @@ def create_exam_registration(request, post_override=None): course_id = post_vars['course_id'] course = (course_from_id(course_id)) # assume it will be found.... + # make sure that any demographic data values received from the page have been stripped. + # Whitespace is not an acceptable response for any of these values + demographic_data = {} + for fieldname in TestCenterUser.user_provided_fields(): + if fieldname in post_vars: + demographic_data[fieldname] = (post_vars[fieldname]).strip() try: testcenter_user = TestCenterUser.objects.get(user=user) - needs_updating = testcenter_user.needs_update(post_vars) + needs_updating = testcenter_user.needs_update(demographic_data) log.info("User {0} enrolled in course {1} {2}updating demographic info for exam registration".format(user.username, course_id, "" if needs_updating else "not ")) except TestCenterUser.DoesNotExist: # do additional initialization here: From d2e130ab33a50304db29a169ba462011ecc1c80a Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Wed, 23 Jan 2013 18:42:35 -0500 Subject: [PATCH 026/388] Removing extra parens --- common/djangoapps/student/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index d9ead9c6fb..968a49aa1d 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -691,7 +691,7 @@ def create_exam_registration(request, post_override=None): username = post_vars['username'] user = User.objects.get(username=username) course_id = post_vars['course_id'] - course = (course_from_id(course_id)) # assume it will be found.... + course = course_from_id(course_id) # assume it will be found.... # make sure that any demographic data values received from the page have been stripped. # Whitespace is not an acceptable response for any of these values From 4af2e1118a2d970760e7eee04c2d32d0e78cecff Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Wed, 23 Jan 2013 18:44:26 -0500 Subject: [PATCH 027/388] Changing login and register to login_user and register_user --- common/djangoapps/student/views.py | 4 ++-- lms/urls.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 968a49aa1d..ecd502ac13 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -204,14 +204,14 @@ def _cert_info(user, course, cert_status): return d -def login(request): +def login_user(request): """ This view will display the non-modal login form """ context = {} return render_to_response('login.html', context) -def register(request): +def register_user(request): """ This view will display the non-modal registration form """ diff --git a/lms/urls.py b/lms/urls.py index fa39c56cef..a2c02ef2de 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -15,8 +15,8 @@ urlpatterns = ('', url(r'^update_certificate$', 'certificates.views.update_certificate'), url(r'^$', 'branding.views.index', name="root"), # Main marketing page, or redirect to courseware url(r'^dashboard$', 'student.views.dashboard', name="dashboard"), - url(r'^signin$', 'student.views.login', name="login"), - url(r'^register$', 'student.views.register', name="register"), + url(r'^signin$', 'student.views.login_user', name="login_user"), + url(r'^register$', 'student.views.register_user', name="register_user"), url(r'^admin_dashboard$', 'dashboard.views.dashboard'), From 38e3d7371b9c858a0e65edc04c697e8d7c1c3736 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Thu, 24 Jan 2013 12:46:35 -0500 Subject: [PATCH 028/388] drupal integration - added in right side copy to registration marketing requested --- lms/static/sass/multicourse/_account.scss | 11 +++++++++++ lms/templates/register.html | 17 +++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lms/static/sass/multicourse/_account.scss b/lms/static/sass/multicourse/_account.scss index c2be97c9bd..8a088c9d6b 100644 --- a/lms/static/sass/multicourse/_account.scss +++ b/lms/static/sass/multicourse/_account.scss @@ -148,6 +148,17 @@ color: tint($m-gray, 30%); font-size: em(14); } + + ol, ul { + margin: 0; + padding: 0; + list-style: none; + + li { + margin: 0 0 ($baseline/2); + line-height: 1.6em; + } + } } } diff --git a/lms/templates/register.html b/lms/templates/register.html index 30d7f6a493..1746fc15d6 100644 --- a/lms/templates/register.html +++ b/lms/templates/register.html @@ -212,12 +212,21 @@

    Welcome to edX

    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis. [Matt to provide copy]

    +

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. [Matt to provide copy]

    -
    -

    What an edX Account Means

    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis. [Matt to provide copy]

    +
    +

    What an edX Account Gives You

    +

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes. [Matt to provide copy]

    +
    + +
    +

    Next Steps

    +
      +
    1. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    2. +
    3. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes.
    4. +
    5. Donec quam felis, ultricies nec, pellentesque eu, pretium quis. [Matt to provide copy]
    6. +
    From 4596fa417f4794ee9d29b90e2c5989117a73cece Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Tue, 19 Feb 2013 17:31:22 -0500 Subject: [PATCH 029/388] Changing login and signin view names --- common/djangoapps/student/views.py | 50 +++++++++++++++--------------- lms/urls.py | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 16673379ef..7d4e492711 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -212,7 +212,7 @@ def _cert_info(user, course, cert_status): return d -def login_user(request): +def signin_user(request): """ This view will display the non-modal login form """ @@ -1085,14 +1085,14 @@ def accept_name_change(request): @csrf_exempt def test_center_login(request): - # errors are returned by navigating to the error_url, adding a query parameter named "code" + # errors are returned by navigating to the error_url, adding a query parameter named "code" # which contains the error code describing the exceptional condition. def makeErrorURL(error_url, error_code): log.error("generating error URL with error code {}".format(error_code)) return "{}?code={}".format(error_url, error_code); - + # get provided error URL, which will be used as a known prefix for returning error messages to the - # Pearson shell. + # Pearson shell. error_url = request.POST.get("errorURL") # TODO: check that the parameters have not been tampered with, by comparing the code provided by Pearson @@ -1103,12 +1103,12 @@ def test_center_login(request): # calculate SHA for query string # TODO: figure out how to get the original query string, so we can hash it and compare. - - + + if 'clientCandidateID' not in request.POST: return HttpResponseRedirect(makeErrorURL(error_url, "missingClientCandidateID")); client_candidate_id = request.POST.get("clientCandidateID") - + # TODO: check remaining parameters, and maybe at least log if they're not matching # expected values.... # registration_id = request.POST.get("registrationID") @@ -1122,12 +1122,12 @@ def test_center_login(request): return HttpResponseRedirect(makeErrorURL(error_url, "invalidClientCandidateID")); # find testcenter_registration that matches the provided exam code: - # Note that we could rely in future on either the registrationId or the exam code, - # or possibly both. But for now we know what to do with an ExamSeriesCode, + # Note that we could rely in future on either the registrationId or the exam code, + # or possibly both. But for now we know what to do with an ExamSeriesCode, # while we currently have no record of RegistrationID values at all. if 'vueExamSeriesCode' not in request.POST: - # we are not allowed to make up a new error code, according to Pearson, - # so instead of "missingExamSeriesCode", we use a valid one that is + # we are not allowed to make up a new error code, according to Pearson, + # so instead of "missingExamSeriesCode", we use a valid one that is # inaccurate but at least distinct. (Sigh.) log.error("missing exam series code for cand ID {}".format(client_candidate_id)) return HttpResponseRedirect(makeErrorURL(error_url, "missingPartnerID")); @@ -1141,11 +1141,11 @@ def test_center_login(request): if not registrations: log.error("not able to find exam registration for exam {} and cand ID {}".format(exam_series_code, client_candidate_id)) return HttpResponseRedirect(makeErrorURL(error_url, "noTestsAssigned")); - + # TODO: figure out what to do if there are more than one registrations.... # for now, just take the first... registration = registrations[0] - + course_id = registration.course_id course = course_from_id(course_id) # assume it will be found.... if not course: @@ -1163,19 +1163,19 @@ def test_center_login(request): if not timelimit_descriptor: log.error("cand {} on exam {} for course {}: descriptor not found for location {}".format(client_candidate_id, exam_series_code, course_id, location)) return HttpResponseRedirect(makeErrorURL(error_url, "missingClientProgram")); - - timelimit_module_cache = StudentModuleCache.cache_for_descriptor_descendents(course_id, testcenteruser.user, + + timelimit_module_cache = StudentModuleCache.cache_for_descriptor_descendents(course_id, testcenteruser.user, timelimit_descriptor, depth=None) - timelimit_module = get_module_for_descriptor(request.user, request, timelimit_descriptor, + timelimit_module = get_module_for_descriptor(request.user, request, timelimit_descriptor, timelimit_module_cache, course_id, position=None) if not timelimit_module.category == 'timelimit': log.error("cand {} on exam {} for course {}: non-timelimit module at location {}".format(client_candidate_id, exam_series_code, course_id, location)) return HttpResponseRedirect(makeErrorURL(error_url, "missingClientProgram")); - + if timelimit_module and timelimit_module.has_ended: log.warning("cand {} on exam {} for course {}: test already over at {}".format(client_candidate_id, exam_series_code, course_id, timelimit_module.ending_at)) return HttpResponseRedirect(makeErrorURL(error_url, "allTestsTaken")); - + # check if we need to provide an accommodation: time_accommodation_mapping = {'ET12ET' : 'ADDHALFTIME', 'ET30MN' : 'ADD30MIN', @@ -1188,27 +1188,27 @@ def test_center_login(request): # special, hard-coded client ID used by Pearson shell for testing: if client_candidate_id == "edX003671291147": time_accommodation_code = 'TESTING' - + if time_accommodation_code: timelimit_module.accommodation_code = time_accommodation_code instance_module = get_instance_module(course_id, testcenteruser.user, timelimit_module, timelimit_module_cache) instance_module.state = timelimit_module.get_instance_state() instance_module.save() log.info("cand {} on exam {} for course {}: receiving accommodation {}".format(client_candidate_id, exam_series_code, course_id, time_accommodation_code)) - + # UGLY HACK!!! - # Login assumes that authentication has occurred, and that there is a + # Login assumes that authentication has occurred, and that there is a # backend annotation on the user object, indicating which backend # against which the user was authenticated. We're authenticating here # against the registration entry, and assuming that the request given # this information is correct, we allow the user to be logged in # without a password. This could all be formalized in a backend object - # that does the above checking. + # that does the above checking. # TODO: (brian) create a backend class to do this. - # testcenteruser.user.backend = "%s.%s" % (backend.__module__, backend.__class__.__name__) - testcenteruser.user.backend = "%s.%s" % ("TestcenterAuthenticationModule", "TestcenterAuthenticationClass") + # testcenteruser.user.backend = "%s.%s" % (backend.__module__, backend.__class__.__name__) + testcenteruser.user.backend = "%s.%s" % ("TestcenterAuthenticationModule", "TestcenterAuthenticationClass") login(request, testcenteruser.user) - + # And start the test: return jump_to(request, course_id, location) diff --git a/lms/urls.py b/lms/urls.py index 8a2e09a7e4..864cbc919f 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -15,7 +15,7 @@ urlpatterns = ('', url(r'^update_certificate$', 'certificates.views.update_certificate'), url(r'^$', 'branding.views.index', name="root"), # Main marketing page, or redirect to courseware url(r'^dashboard$', 'student.views.dashboard', name="dashboard"), - url(r'^signin$', 'student.views.login_user', name="login_user"), + url(r'^signin$', 'student.views.signin_user', name="signin_user"), url(r'^register$', 'student.views.register_user', name="register_user"), url(r'^admin_dashboard$', 'dashboard.views.dashboard'), From 074f866b58822f30ec1326ce652d1662d2f41c51 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Tue, 19 Feb 2013 17:32:17 -0500 Subject: [PATCH 030/388] resolving some light footer display issues --- lms/static/sass/shared/_footer.scss | 4 ++-- lms/templates/footer.html | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lms/static/sass/shared/_footer.scss b/lms/static/sass/shared/_footer.scss index 72fd3c00ce..d4ecc735fe 100644 --- a/lms/static/sass/shared/_footer.scss +++ b/lms/static/sass/shared/_footer.scss @@ -33,7 +33,7 @@ // colophon .colophon { margin-right: flex-gutter(2); - width: flex-grid(6); + width: flex-grid(6,12); float: left; .nav-colophon { @@ -82,7 +82,7 @@ // references .references { margin: -10px 0 0 0; - width: flex-grid(4); + width: flex-grid(4,12); float: right; .nav-social { diff --git a/lms/templates/footer.html b/lms/templates/footer.html index 035c6b950f..642f0cfe01 100644 --- a/lms/templates/footer.html +++ b/lms/templates/footer.html @@ -33,11 +33,9 @@
    -
    - +

    EdX is a non-profit created by founding partners Harvard and MIT whose mission is to bring the best of higher education to students of all ages anywhere in the world, wherever there is Internet access. EdX’s free online MOOCs are interactive and subjects include computer science, public health, and artificial intelligence.

    +
    +
    ",wrapper:'
    '},c.prototype.options={readOnly:!1},c.prototype.plugins={},c.prototype.editor=null,c.prototype.viewer=null,c.prototype.selectedRanges=null,c.prototype.mouseIsDown=!1,c.prototype.ignoreMouseup=!1,c.prototype.viewerHideTimer=null,c.prototype._setupWrapper=function(){return this.wrapper=a(this.html.wrapper),this.element.find("script").remove(),this.element.wrapInner(this.wrapper),this.wrapper=this.element.find(".annotator-wrapper"),this},c.prototype._setupViewer=function(){var b=this;return this.viewer=new c.Viewer({readOnly:this.options.readOnly}),this.viewer.hide().on("edit",this.onEditAnnotation).on("delete",this.onDeleteAnnotation).addField({load:function(c,d){return d.text?a(c).escape(d.text):a(c).html(""+s("No Comment")+""),b.publish("annotationViewerTextField",[c,d])}}).element.appendTo(this.wrapper).bind({mouseover:this.clearViewerHideTimer,mouseout:this.startViewerHideTimer}),this},c.prototype._setupEditor=function(){return this.editor=new c.Editor,this.editor.hide().on("hide",this.onEditorHide).on("save",this.onEditorSubmit).addField({type:"textarea",label:s("Comments")+"…",load:function(b,c){return a(b).find("textarea").val(c.text||"")},submit:function(b,c){return c.text=a(b).find("textarea").val()}}),this.editor.element.appendTo(this.wrapper),this},c.prototype._setupDocumentEvents=function(){return a(document).bind({mouseup:this.checkForEndSelection,mousedown:this.checkForStartSelection}),this},c.prototype._setupDynamicStyle=function(){var b,c,d,e;return d=a("#annotator-dynamic-style"),d.length||(d=a('').appendTo(document.head)),c="*"+function(){var a,b,c,d;c=["adder","outer","notice","filter"],d=[];for(a=0,b=c.length;aa;0<=a?c++:c--)f=i.getRangeAt(c),b=new e.BrowserRange(f),d=b.normalize().limit(this.wrapper[0]),d===null&&h.push(f),g.push(d);return g}.call(this),i.removeAllRanges());for(k=0,l=h.length;k0?setTimeout(function(){return c(a)},10):d.publish("annotationsLoaded",[b])},b=a.slice(),a.length&&c(a),this},c.prototype.dumpAnnotations=function(){return this.plugins.Store?this.plugins.Store.dumpAnnotations():console.warn(s("Can't dump annotations without Store plugin."))},c.prototype.highlightRange=function(b,c){var d,e,f,g,h,i,j;c==null&&(c="annotator-hl"),f=/^\s*$/,d=a(""),i=b.textNodes(),j=[];for(g=0,h=i.length;g tag?"))),this},c.prototype.showEditor=function(a,b){return this.editor.element.css(b),this.editor.load(a),this.publish("annotationEditorShown",[this.editor,a]),this},c.prototype.onEditorHide=function(){return this.publish("annotationEditorHidden",[this.editor]),this.ignoreMouseup=!1},c.prototype.onEditorSubmit=function(a){return this.publish("annotationEditorSubmit",[this.editor,a]),a.ranges===void 0?this.setupAnnotation(a):this.updateAnnotation(a)},c.prototype.showViewer=function(a,b){return this.viewer.element.css(b),this.viewer.load(a),this.publish("annotationViewerShown",[this.viewer,a])},c.prototype.startViewerHideTimer=function(){if(!this.viewerHideTimer)return this.viewerHideTimer=setTimeout(this.viewer.hide,250)},c.prototype.clearViewerHideTimer=function(){return clearTimeout(this.viewerHideTimer),this.viewerHideTimer=!1},c.prototype.checkForStartSelection=function(a){if(!a||!this.isAnnotator(a.target))return this.startViewerHideTimer(),this.mouseIsDown=!0},c.prototype.checkForEndSelection=function(b){var c,d,e,f,g;this.mouseIsDown=!1;if(this.ignoreMouseup)return;this.selectedRanges=this.getSelectedRanges(),g=this.selectedRanges;for(e=0,f=g.length;e0&&this.invertX(),this},d.prototype.resetOrientation=function(){return this.element.removeClass(this.classes.invert.x).removeClass(this.classes.invert.y),this},d.prototype.invertX=function(){return this.element.addClass(this.classes.invert.x),this},d.prototype.invertY=function(){return this.element.addClass(this.classes.invert.y),this},d.prototype.isInvertedY=function(){return this.element.hasClass(this.classes.invert.y)},d.prototype.isInvertedX=function(){return this.element.hasClass(this.classes.invert.x)},d}(c),b.Editor=function(b){function c(b){this.onCancelButtonMouseover=w(this.onCancelButtonMouseover,this),this.processKeypress=w(this.processKeypress,this),this.submit=w(this.submit,this),this.load=w(this.load,this),this.hide=w(this.hide,this),this.show=w(this.show,this),c.__super__.constructor.call(this,a(this.html)[0],b),this.fields=[],this.annotation={}}return v(c,b),c.prototype.events={"form submit":"submit",".annotator-save click":"submit",".annotator-cancel click":"hide",".annotator-cancel mouseover":"onCancelButtonMouseover","textarea keydown":"processKeypress"},c.prototype.classes={hide:"annotator-hide",focus:"annotator-focus"},c.prototype.html='
    \n
    \n
      \n \n
      \n
      ",c.prototype.options={},c.prototype.show=function(a){return j.preventEventDefault(a),this.element.removeClass(this.classes.hide),this.element.find(".annotator-save").addClass(this.classes.focus),this.checkOrientation(),this.element.find(":input:first").focus(),this.setupDraggables(),this.publish("show")},c.prototype.hide=function(a){return j.preventEventDefault(a),this.element.addClass(this.classes.hide),this.publish("hide")},c.prototype.load=function(a){var b,c,d,e;this.annotation=a,this.publish("load",[this.annotation]),e=this.fields;for(c=0,d=e.length;c'),d.element=c[0];switch(d.type){case"textarea":e=a(" From f50100082517d216dec824f163c87d1c32f9b07c Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Wed, 3 Apr 2013 09:46:36 -0400 Subject: [PATCH 060/388] edx.org - hiding the login nav element when on the login view --- lms/static/sass/multicourse/_account.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lms/static/sass/multicourse/_account.scss b/lms/static/sass/multicourse/_account.scss index 32a0d08bc0..e5376fd7bf 100644 --- a/lms/static/sass/multicourse/_account.scss +++ b/lms/static/sass/multicourse/_account.scss @@ -481,6 +481,10 @@ // login .view-login { + header.global .nav-courseware .cta-login { + display: none; + } + .introduction { padding: 0; From 13b741750af28e4bfb0fff4a869a16637ab66ace Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Mon, 8 Apr 2013 22:16:32 -0400 Subject: [PATCH 061/388] edx.org - basic styling of password reset form --- lms/static/sass/multicourse/_account.scss | 27 ++- .../registration/password_reset_confirm.html | 166 ++++++++++-------- 2 files changed, 110 insertions(+), 83 deletions(-) diff --git a/lms/static/sass/multicourse/_account.scss b/lms/static/sass/multicourse/_account.scss index e5376fd7bf..4a517cacac 100644 --- a/lms/static/sass/multicourse/_account.scss +++ b/lms/static/sass/multicourse/_account.scss @@ -273,7 +273,7 @@ input, textarea { width: 100%; margin: 0; - padding: $baseline ($baseline*.75); + padding: $baseline ($baseline*.75); &.long { width: 100%; @@ -338,7 +338,7 @@ &.is-focused { label { - color: $m-blue-s1; + color: $m-blue-s1; } .tip { @@ -464,7 +464,7 @@ padding: 0 $baseline/4; } - #register-form, #login-form { + #register-form, #login-form, #passwordreset-form { .status.message { display: none; @@ -512,9 +512,26 @@ // password reset .view-passwordreset { + background: $m-gray-l2; + + header.global { + + h1 { + float: none; + } + } .introduction { + width: auto; + padding: 0; + header h1 { + margin: 0; + } + } + + .content { + margin-top: 0; } } @@ -586,7 +603,7 @@ width: 100%; } } - } + } } .modal-form-error { @@ -599,4 +616,4 @@ border-bottom: 3px solid shade($red, 10%); background: tint($red,95%); } -} \ No newline at end of file +} diff --git a/lms/templates/registration/password_reset_confirm.html b/lms/templates/registration/password_reset_confirm.html index aaf264949d..1f11b207bf 100644 --- a/lms/templates/registration/password_reset_confirm.html +++ b/lms/templates/registration/password_reset_confirm.html @@ -38,84 +38,94 @@ - + -
      -
      -
      -

      Reset Your edX Password

      -
      +
      + +
      + +
      +
      +
      +
      +

      Reset Your edX Password

      +
      +
      + +
      + {% if validlink %} +
      +

      Password Reset Form

      +
      + +
      {% csrf_token %} + + + + + + + +

      + Please enter your new password twice so we can verify you typed it in correctly.
      + Required fields are noted by bold text and an asterisk (*). +

      + +
      + Required Information + +
        +
      1. + + +
      2. +
      3. + + +
      4. +
      +
      + +
      + +
      +
      + + {% else %} + +
      +

      Your Password Reset Was Unsuccessful

      +
      +

      The password reset link was invalid, possibly because the link has already been used. Please request a new password reset.

      + + {% endif %} +
      + +
      - -
      - {% if validlink %} -
      - -
      - -
      {% csrf_token %} - - - - - - - -

      - Please enter your new password twice so we can verify you typed it in correctly.
      - Required fields are noted by bold text and an asterisk (*). -

      - -
      - - -
        -
      1. - - -
      2. -
      3. - - -
      4. -
      -
      - -
      - -
      -
      - - {% else %} - -
      - -
      -

      The password reset link was invalid, possibly because the link has already been used. Please request a new password reset.

      - - {% endif %} -
      - -
      From d8368447fd84f90e72c7b3032ba997c64f0f0a9c Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Mon, 8 Apr 2013 22:35:06 -0400 Subject: [PATCH 062/388] edx.org - adjusted input height and padding to handle previously uneditable fieldsin firefox --- lms/static/sass/multicourse/_account.scss | 3 ++- lms/static/sass/multicourse/_password_reset.scss | 1 + lms/templates/registration/password_reset_confirm.html | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lms/static/sass/multicourse/_account.scss b/lms/static/sass/multicourse/_account.scss index 4a517cacac..5e1965ae43 100644 --- a/lms/static/sass/multicourse/_account.scss +++ b/lms/static/sass/multicourse/_account.scss @@ -250,6 +250,7 @@ label, input, textarea { @include border-radius(0); display: block; + height: auto; font-family: $sans-serif; font-style: normal; font-weight: 500; @@ -273,7 +274,7 @@ input, textarea { width: 100%; margin: 0; - padding: $baseline ($baseline*.75); + padding: ($baseline/2) ($baseline*.75); &.long { width: 100%; diff --git a/lms/static/sass/multicourse/_password_reset.scss b/lms/static/sass/multicourse/_password_reset.scss index a2365e3e3e..9f145351d1 100644 --- a/lms/static/sass/multicourse/_password_reset.scss +++ b/lms/static/sass/multicourse/_password_reset.scss @@ -73,6 +73,7 @@ input[type="email"], input[type="text"], input[type="password"] { + border: 1px solid red !important; background: rgb(255,255,255); display: block; height: 45px; diff --git a/lms/templates/registration/password_reset_confirm.html b/lms/templates/registration/password_reset_confirm.html index 1f11b207bf..96065d889b 100644 --- a/lms/templates/registration/password_reset_confirm.html +++ b/lms/templates/registration/password_reset_confirm.html @@ -93,11 +93,11 @@
      1. - +
      2. - +
      From 2b309adf9c9dde45ba46a2200ea60eba43c1e311 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Thu, 28 Mar 2013 13:26:41 -0400 Subject: [PATCH 063/388] Fixing cookie handling for edx-mktg-loggedin --- common/djangoapps/student/views.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 55bd0e81f9..1033b177df 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -419,6 +419,9 @@ def login_user(request, error=""): response = HttpResponse(json.dumps({'success': True})) # set the login cookie for the edx marketing site + # we want this cookie to be accessed via javascript + # so httponly is set to None + if request.session.get_expire_at_browser_close(): max_age = None expires = None @@ -427,12 +430,13 @@ def login_user(request, error=""): expires_time = time.time() + max_age expires = cookie_date(expires_time) + response.set_cookie(settings.EDXMKTG_COOKIE_NAME, 'true', max_age=max_age, expires=expires, domain=settings.SESSION_COOKIE_DOMAIN, - path=settings.SESSION_COOKIE_PATH, - secure=settings.SESSION_COOKIE_SECURE or None, - httponly=settings.SESSION_COOKIE_HTTPONLY or None) + path='/', + secure=None, + httponly=None) return response @@ -457,7 +461,8 @@ def logout_user(request): logout(request) response = redirect('/') response.delete_cookie(settings.EDXMKTG_COOKIE_NAME, - settings.SESSION_COOKIE_DOMAIN) + path='/', + domain=settings.SESSION_COOKIE_DOMAIN) return response From c3e5469596760048f8ac85235370c484ef7cebde Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Tue, 9 Apr 2013 15:11:06 -0400 Subject: [PATCH 064/388] changing password reset fields to match what is used now --- .../registration/password_reset_confirm.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lms/templates/registration/password_reset_confirm.html b/lms/templates/registration/password_reset_confirm.html index 96065d889b..c89acd2ff0 100644 --- a/lms/templates/registration/password_reset_confirm.html +++ b/lms/templates/registration/password_reset_confirm.html @@ -91,13 +91,13 @@ Required Information
        -
      1. - - +
      2. + +
      3. -
      4. - - +
      5. + +
      From 86dbfd34a1fe0ca678da0f36d15386d7653bca76 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Tue, 9 Apr 2013 15:38:10 -0400 Subject: [PATCH 065/388] edx.org - added basic styles to match previous password reset form to complete view --- .../registration/password_reset_complete.html | 65 +++++++++++++++++-- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/lms/templates/registration/password_reset_complete.html b/lms/templates/registration/password_reset_complete.html index 0338ce57b0..a88176c485 100644 --- a/lms/templates/registration/password_reset_complete.html +++ b/lms/templates/registration/password_reset_complete.html @@ -1,9 +1,66 @@ {% load i18n %} +{% load compressed %} +{% load staticfiles %} + + + -

      Password reset complete

      + Your Password Reset is Complete -{% block content %} + {% compressed_css 'application' %} -Your password has been set. You may go ahead and log in now. + -{% endblock %} + + + + + + +
      + +
      + +
      +
      +
      +
      +

      Your Password Reset is Complete

      +
      +
      + + {% block content %} +
      +

      Your password has been set. You may go ahead and log in now..

      +
      + {% endblock %} +
      +
      From b5ec11afa089444234db0c1797b5b378bcccdbf4 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Wed, 10 Apr 2013 11:26:00 -0400 Subject: [PATCH 066/388] edx.org - adding in more UI status when processing login/register forms --- lms/templates/login.html | 17 +++++++++-------- lms/templates/register.html | 15 ++++++++------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lms/templates/login.html b/lms/templates/login.html index 6627da6e18..8290743418 100644 --- a/lms/templates/login.html +++ b/lms/templates/login.html @@ -7,7 +7,7 @@ <%block name="js_extra"> @@ -76,7 +77,7 @@
      - +

      - Please provide the following information to log into your edX account. Required fields are noted by bold text and an asterisk (*). + Please provide the following information to log into your edX account. Required fields are noted by bold text and an asterisk (*).

      @@ -100,7 +101,7 @@
      1. - +
      2. diff --git a/lms/templates/register.html b/lms/templates/register.html index f5e4511c09..7e79f420e6 100644 --- a/lms/templates/register.html +++ b/lms/templates/register.html @@ -37,7 +37,7 @@ (function() { $(document).delegate('#register-form', 'ajax:success', function(data, json, xhr) { if(json.success) { - $('.message.submission-error').removeClass('is-shown'); + $('.message.submission-error').removeClass('is-shown'); toggleSubmitButton(); location.href="${reverse('dashboard')}"; } else { @@ -52,13 +52,14 @@ function toggleSubmitButton(e) { var $msgError = $('form .status.submission-error'); var $submitButton = $('form .form-actions #submit').prop('disabled', true); + var $submitButtonCopy = $submitButton.html(); if(!$msgError.hasClass('is-shown')) { - $submitButton.prop('disabled', true); + $submitButton.prop('disabled', true).html('Processing your registration …'); } else { - $submitButton.prop('disabled', false); + $submitButton.prop('disabled', false).html($submitButtonCopy); } } @@ -77,7 +78,7 @@ - + -
      \ No newline at end of file +
      From 22a56fddb4705de86180ba59b249b4854dff617a Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Wed, 10 Apr 2013 13:38:25 -0400 Subject: [PATCH 067/388] edx.org - adding in an intermediate disabled state for login/register submit buttons when the form is first processed --- lms/static/sass/multicourse/_account.scss | 2 +- lms/templates/login.html | 2 ++ lms/templates/register.html | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lms/static/sass/multicourse/_account.scss b/lms/static/sass/multicourse/_account.scss index 5e1965ae43..eab8cbe66b 100644 --- a/lms/static/sass/multicourse/_account.scss +++ b/lms/static/sass/multicourse/_account.scss @@ -391,7 +391,7 @@ button[type="submit"] { @extend .button-primary; - &:disabled { + &:disabled, &.is-disabled { opacity: 0.3; cursor: default !important; } diff --git a/lms/templates/login.html b/lms/templates/login.html index 8290743418..2e0281f4f6 100644 --- a/lms/templates/login.html +++ b/lms/templates/login.html @@ -30,6 +30,8 @@ (function() { $(document).delegate('#login-form', 'ajax:success', function(data, json, xhr) { + $(this).find('.form-actions #submit').addClass('is-disabled'); + if(json.success) { $('.message.submission-error').removeClass('is-shown'); toggleSubmitButton(); diff --git a/lms/templates/register.html b/lms/templates/register.html index 7e79f420e6..ee06a3caa0 100644 --- a/lms/templates/register.html +++ b/lms/templates/register.html @@ -36,6 +36,8 @@ (function() { $(document).delegate('#register-form', 'ajax:success', function(data, json, xhr) { + $(this).find('.form-actions #submit').addClass('is-disabled'); + if(json.success) { $('.message.submission-error').removeClass('is-shown'); toggleSubmitButton(); From 54e5e3d31fecfb4ffda1e4b2b3e5ec9e8d6ead00 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Wed, 10 Apr 2013 14:29:47 -0400 Subject: [PATCH 068/388] Adding the EDX_MKTG feature flag and links back to the marketing site --- lms/djangoapps/branding/views.py | 2 ++ lms/envs/aws.py | 1 + lms/templates/navigation.html | 20 +++++++++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lms/djangoapps/branding/views.py b/lms/djangoapps/branding/views.py index 9fe912e947..1b29b8eb09 100644 --- a/lms/djangoapps/branding/views.py +++ b/lms/djangoapps/branding/views.py @@ -22,6 +22,8 @@ def index(request): if settings.MITX_FEATURES.get('AUTH_USE_MIT_CERTIFICATES'): from external_auth.views import ssl_login return ssl_login(request) + if settings.MITX_FEATURES.get('ENABLE_MKTG_SITE'): + return redirect(settings.MKTG_URLS.get('ROOT')) university = branding.get_university(request.META.get('HTTP_HOST')) if university is None: diff --git a/lms/envs/aws.py b/lms/envs/aws.py index aa30315eca..769caf615c 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -80,6 +80,7 @@ META_UNIVERSITIES = ENV_TOKENS.get('META_UNIVERSITIES', {}) COMMENTS_SERVICE_URL = ENV_TOKENS.get("COMMENTS_SERVICE_URL", '') COMMENTS_SERVICE_KEY = ENV_TOKENS.get("COMMENTS_SERVICE_KEY", '') CERT_QUEUE = ENV_TOKENS.get("CERT_QUEUE", 'test-pull') +MKTG_URLS = ENV_TOKENS.get('MKTG_URLS', {}) ############################## SECURE AUTH ITEMS ############### # Secret things: passwords, access keys, etc. diff --git a/lms/templates/navigation.html b/lms/templates/navigation.html index 091078d009..ee51a5ff98 100644 --- a/lms/templates/navigation.html +++ b/lms/templates/navigation.html @@ -45,12 +45,16 @@ site_status_msg = get_site_status_msg(course_id) % endif % if user.is_authenticated(): + -
      1. @@ -69,18 +73,20 @@ site_status_msg = get_site_status_msg(course_id) % else: @@ -88,7 +94,7 @@ site_status_msg = get_site_status_msg(course_id) From 0c1fd783cb5bc3911bb9397b77b556ad405e4569 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Thu, 11 Apr 2013 10:44:22 -0400 Subject: [PATCH 069/388] Setting the edxloggedin cookie on registration Previously it was only set for login --- common/djangoapps/student/views.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 1033b177df..615d72b391 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -658,7 +658,31 @@ def create_account(request, post_override=None): statsd.increment("common.student.account_created") js = {'success': True} - return HttpResponse(json.dumps(js), mimetype="application/json") + HttpResponse(json.dumps(js), mimetype="application/json") + + response = HttpResponse(json.dumps({'success': True})) + + # set the login cookie for the edx marketing site + # we want this cookie to be accessed via javascript + # so httponly is set to None + + if request.session.get_expire_at_browser_close(): + max_age = None + expires = None + else: + max_age = request.session.get_expiry_age() + expires_time = time.time() + max_age + expires = cookie_date(expires_time) + + + response.set_cookie(settings.EDXMKTG_COOKIE_NAME, + 'true', max_age=max_age, + expires=expires, domain=settings.SESSION_COOKIE_DOMAIN, + path='/', + secure=None, + httponly=None) + return response + def exam_registration_info(user, course): From 01f8c4c81629707edd590b1264dd1a9f78aaea90 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Tue, 30 Apr 2013 09:44:21 -0400 Subject: [PATCH 070/388] Adding iframe view example: http://localhost:8000/courses/HarvardX/CB22x/2013_Spring/mktg-about --- lms/djangoapps/courseware/views.py | 20 ++++ .../courseware/mktg_course_about.html | 98 +++++++++++++++++++ lms/urls.py | 6 +- 3 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 lms/templates/courseware/mktg_course_about.html diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index 714e45842f..acbd4183cc 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -518,6 +518,26 @@ def course_about(request, course_id): 'registered': registered, 'course_target': course_target, 'show_courseware_link': show_courseware_link}) +@ensure_csrf_cookie +@cache_if_anonymous +def mktg_course_about(request, course_id): + course = get_course_with_access(request.user, course_id, 'see_exists') + registered = registered_for_course(course, request.user) + + if has_access(request.user, course, 'load'): + course_target = reverse('info', args=[course.id]) + else: + course_target = reverse('about_course', args=[course.id]) + + show_courseware_link = (has_access(request.user, course, 'load') or + settings.MITX_FEATURES.get('ENABLE_LMS_MIGRATION')) + + return render_to_response('courseware/mktg_course_about.html', + {'course': course, + 'registered': registered, + 'course_target': course_target, + 'show_courseware_link': show_courseware_link}) + @ensure_csrf_cookie diff --git a/lms/templates/courseware/mktg_course_about.html b/lms/templates/courseware/mktg_course_about.html new file mode 100644 index 0000000000..147eb5dd64 --- /dev/null +++ b/lms/templates/courseware/mktg_course_about.html @@ -0,0 +1,98 @@ +<%! + from django.core.urlresolvers import reverse + from courseware.courses import course_image_url, get_course_about_section + from courseware.access import has_access +%> +<%namespace name='static' file='../static_content.html'/> + +<%inherit file="../mktg_iframe.html" /> + +<%block name="headextra"> + <%include file="../google_analytics.html" /> + + +<%block name="js_extra"> + + % if not registered: + %if user.is_authenticated(): + ## If the user is authenticated, clicking the enroll button just submits a form + + %else: + ## If the user is not authenticated, clicking the enroll button pops up the register + ## field. We also slip in the registration fields into the login/register fields so + ## the user is automatically registered after logging in / registering + + %endif + %endif + + + + + +<%block name="title">About ${course.number} + +
        +
        +
        +
        + %if user.is_authenticated(): + %if registered: + %if show_courseware_link: + + %endif + You are registered for this course (${course.number}) + %if show_courseware_link: + View Courseware + + %endif + %else: + Register for ${course.number} +
        + %endif + %else: + Register for ${course.number} + %endif +
        + +
        +
        + +%if not registered: +
        + +
        + + +
        +
        + +
        + +
        +%endif + diff --git a/lms/urls.py b/lms/urls.py index 3bcfc25d3d..a866747917 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -239,7 +239,11 @@ if settings.COURSEWARE_ENABLED: #About the course url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/about$', - 'courseware.views.course_about', name="about_course"), + 'courseware.views.mktg_course_about', name="about_course"), + #View for mktg site + url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/mktg-about$', + 'courseware.views.mktg_course_about', name="mktg_about_course"), + #Inside the course url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/$', From aa895cbc6b669ae6a5072c00610c9fd4eb62dc93 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Tue, 30 Apr 2013 13:13:31 -0400 Subject: [PATCH 071/388] Adding mktg_iframe.html --- lms/templates/mktg_iframe.html | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lms/templates/mktg_iframe.html diff --git a/lms/templates/mktg_iframe.html b/lms/templates/mktg_iframe.html new file mode 100644 index 0000000000..9b4d298937 --- /dev/null +++ b/lms/templates/mktg_iframe.html @@ -0,0 +1,37 @@ +<%namespace name='static' file='static_content.html'/> + + + + <%block name="title">edX + + + + <%static:css group='application'/> + + <%static:js group='main_vendor'/> + <%block name="headextra"/> + + + + + + + + % if not course: + <%include file="google_analytics.html" /> + % endif + + + + + + ${self.body()} + <%static:js group='application'/> + <%static:js group='module-js'/> + <%block name="js_extra"/> + + From 7705941a653050e5b5c7a5a4d056a1ff3a4ad6fc Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Thu, 2 May 2013 11:54:16 -0400 Subject: [PATCH 072/388] edx.org - added in isolated register button styling/states for