From afaaca969a20a0a065f4356832041c25ffed568c Mon Sep 17 00:00:00 2001 From: stephensanchez Date: Mon, 6 Oct 2014 15:41:38 +0000 Subject: [PATCH] Adding new styles for dashboard notifications. Change the reverification failure message styling. Changing templates so new styles do not appear in courseware. Removing unused aria tag. PR comments on cleaning up SASS Fix signup LMS test. Copy changes per review on PR Updating based on PR comments Style and HTML changes for notifications --- common/djangoapps/student/views.py | 5 +- .../courseware/features/signup.feature | 2 +- .../sass/elements/_system-feedback.scss | 2 - lms/static/sass/multicourse/_dashboard.scss | 49 ++++++++++-------- lms/templates/dashboard.html | 51 +++++++++++-------- .../_dashboard_prompt_midcourse_reverify.html | 10 ++-- .../_dashboard_third_party_error.html | 12 +++++ .../enrollment/course_enrollment_message.html | 13 +++-- .../registration/activate_account_notice.html | 18 ++++++- 9 files changed, 105 insertions(+), 57 deletions(-) create mode 100644 lms/templates/dashboard/_dashboard_third_party_error.html diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 6adca7a26c..2fecaf66da 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -480,7 +480,10 @@ def dashboard(request): message = "" if not user.is_active: - message = render_to_string('registration/activate_account_notice.html', {'email': user.email}) + message = render_to_string( + 'registration/activate_account_notice.html', + {'email': user.email, 'platform_name': settings.PLATFORM_NAME} + ) # Global staff can see what courses errored on their dashboard staff_access = False diff --git a/lms/djangoapps/courseware/features/signup.feature b/lms/djangoapps/courseware/features/signup.feature index b04a950bef..60067d5b20 100644 --- a/lms/djangoapps/courseware/features/signup.feature +++ b/lms/djangoapps/courseware/features/signup.feature @@ -16,4 +16,4 @@ Feature: LMS.Sign in And I check the checkbox named "terms_of_service" And I check the checkbox named "honor_code" And I submit the registration form - Then I should see "THANKS FOR REGISTERING!" in the dashboard banner + Then I should see "Thanks for Registering!" in the dashboard banner diff --git a/lms/static/sass/elements/_system-feedback.scss b/lms/static/sass/elements/_system-feedback.scss index 2943df4dc8..9a6061fa32 100644 --- a/lms/static/sass/elements/_system-feedback.scss +++ b/lms/static/sass/elements/_system-feedback.scss @@ -6,8 +6,6 @@ // UI : message .wrapper-msg { display: block; - margin-bottom: ($baseline/4); - box-shadow: 0 0 5px $shadow-d1 inset; background: $notify-banner-bg-1; padding: $baseline ($baseline*1.5); diff --git a/lms/static/sass/multicourse/_dashboard.scss b/lms/static/sass/multicourse/_dashboard.scss index 9569ea13ca..f669f65966 100644 --- a/lms/static/sass/multicourse/_dashboard.scss +++ b/lms/static/sass/multicourse/_dashboard.scss @@ -5,27 +5,6 @@ @include clearfix; padding: ($baseline*2) 0 0 0; - .dashboard-banner { - background: $yellow; - border: 1px solid rgb(200,200,200); - box-shadow: 0 1px 0 0 rgba(255,255,255, 0.6); - padding: 10px; - margin-bottom: 30px; - - &:empty { - display: none; - background-color: #FFF; - } - - h2 { - margin-bottom: 0; - } - - p { - margin-bottom: 0; - } - } - .profile-sidebar { float: left; margin-right: flex-gutter(); @@ -1166,3 +1145,31 @@ opacity: 0.5; } +.dashboard-banner { + + &:empty { + display: none; + } + + .wrapper-msg { + padding-bottom: 0; + } + + .msg { + @include clearfix(); + font-family: $sans-serif; + padding-bottom: $baseline; + border-bottom: thin solid $gray; + + &.title { + @extend %t-title5; + @extend %t-weight4; + font-family: $f-sans-serif; + + // Overriding Platform h2 styles + text-transform: none; + letter-spacing: 0; + } + } +} + diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index be4acc8260..23dac72409 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -24,6 +24,13 @@ -% if reverifications["must_reverify"] or reverifications["denied"]: -
- <%include file='dashboard/_dashboard_prompt_midcourse_reverify.html' /> -
-% endif +
+ % if reverifications["must_reverify"] or reverifications["denied"]: + ## Section Element must be outside of the re-verify template. The template is re-used for courseware, and has separate styling. +
+ <%include file='dashboard/_dashboard_prompt_midcourse_reverify.html' /> +
+ % endif -
+ %if message: +
+ ${message} +
+ %endif - %if message: -
- ${message} -
- %endif + % if duplicate_provider: +
+ <%include file='dashboard/_dashboard_third_party_error.html' /> +
+ % endif - %if enrollment_message: - ${enrollment_message} - %endif + %if enrollment_message: +
+ ${enrollment_message} +
+ %endif +
- % if duplicate_provider: -
- ## Translators: this message is displayed when a user tries to link their account with a third-party authentication provider (for example, Google or LinkedIn) with a given edX account, but their third-party account is already associated with another edX account. provider_name is the name of the third-party authentication provider, and platform_name is the name of the edX deployment. -

${_("The {provider_name} account you selected is already linked to another {platform_name} account.").format(provider_name='%s' % duplicate_provider.NAME, platform_name=platform_name)} -

- % endif +
diff --git a/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html b/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html index c77f8d9e3f..9a28db1b7c 100644 --- a/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html +++ b/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html @@ -1,6 +1,5 @@ <%! from django.utils.translation import ugettext as _ %> <%! from django.core.urlresolvers import reverse %> - % if reverifications["must_reverify"]: % if len(reverifications["must_reverify"]) > 1: @@ -32,7 +31,6 @@ - % elif reverifications["must_reverify"]:
@@ -57,13 +55,12 @@
- % endfor %endif %endif %if reverifications["denied"] and denied_banner: -
+

${_("Your re-verification failed")}

@@ -79,13 +76,12 @@ )}

+ % endif + % endfor
- -% endif -% endfor %endif diff --git a/lms/templates/dashboard/_dashboard_third_party_error.html b/lms/templates/dashboard/_dashboard_third_party_error.html new file mode 100644 index 0000000000..99ba0ae4fb --- /dev/null +++ b/lms/templates/dashboard/_dashboard_third_party_error.html @@ -0,0 +1,12 @@ +<%! from django.utils.translation import ugettext as _ %> +
+
+
+

${_("Could Not Link Accounts")}

+
+ ## Translators: this message is displayed when a user tries to link their account with a third-party authentication provider (for example, Google or LinkedIn) with a given edX account, but their third-party account is already associated with another edX account. provider_name is the name of the third-party authentication provider, and platform_name is the name of the edX deployment. +

${_("The {provider_name} account you selected is already linked to another {platform_name} account.").format(provider_name='{duplicate_provider}'.format(duplicate_provider=duplicate_provider.NAME), platform_name=platform_name)}

+
+
+
+
diff --git a/lms/templates/enrollment/course_enrollment_message.html b/lms/templates/enrollment/course_enrollment_message.html index f2d605476f..1311c2509c 100644 --- a/lms/templates/enrollment/course_enrollment_message.html +++ b/lms/templates/enrollment/course_enrollment_message.html @@ -1,6 +1,13 @@ <%! from django.utils.translation import ugettext as _ %> % for course, enrollment in recent_course_enrollment_pairs: -
-

${_("You have successfully enrolled in {enrolled_course}.").format(enrolled_course=course.display_name)}

-
+
+
+
+

${_("Enrollment Successful")}

+
+

${_("You have successfully enrolled in {enrolled_course}.").format(enrolled_course=course.display_name)}

+
+
+
+
% endfor diff --git a/lms/templates/registration/activate_account_notice.html b/lms/templates/registration/activate_account_notice.html index b65a36e273..dc8b4e139f 100644 --- a/lms/templates/registration/activate_account_notice.html +++ b/lms/templates/registration/activate_account_notice.html @@ -1,3 +1,17 @@ <%! from django.utils.translation import ugettext as _ %> -

${_("Thanks For Registering!")}

-

${_("Your account is not active yet. An activation link has been sent to {email}, along with instructions for activating your account.").format(email="{}".format(email))}

+
+
+
+

${_("Thanks for Registering!")}

+
+

${_( + "You've successfully created an account on {platform_name}. We've sent an account " + "activation message to {email}. To activate your account and start enrolling in " + "courses, click the link in the message." + ).format(email="{}".format(email), platform_name=platform_name + )} +

+
+
+
+