From f8da29b9cf236d5473d08b1e1f050de1b2ffb791 Mon Sep 17 00:00:00 2001 From: Chris Rodriguez Date: Thu, 19 Mar 2015 15:22:08 -0400 Subject: [PATCH] Styling for automatic cert generation on Progress page --- lms/djangoapps/courseware/tests/test_views.py | 6 +- lms/static/sass/application-extend2.scss.mako | 1 + lms/static/sass/course/_auto-cert.scss | 38 ++++++++++++ lms/static/sass/course/_profile.scss | 10 +++ .../sass/elements/_system-feedback.scss | 3 +- lms/templates/courseware/progress.html | 62 ++++++++++++------- 6 files changed, 93 insertions(+), 27 deletions(-) create mode 100644 lms/static/sass/course/_auto-cert.scss diff --git a/lms/djangoapps/courseware/tests/test_views.py b/lms/djangoapps/courseware/tests/test_views.py index 0182719528..a4a444b13e 100644 --- a/lms/djangoapps/courseware/tests/test_views.py +++ b/lms/djangoapps/courseware/tests/test_views.py @@ -763,17 +763,17 @@ class ProgressPageTests(ModuleStoreTestCase): def test_generate_cert_config(self): resp = views.progress(self.request, course_id=unicode(self.course.id)) - self.assertNotContains(resp, 'Create Your Certificate') + self.assertNotContains(resp, 'Request Certificate') # Enable the feature, but do not enable it for this course CertificateGenerationConfiguration(enabled=True).save() resp = views.progress(self.request, course_id=unicode(self.course.id)) - self.assertNotContains(resp, 'Create Your Certificate') + self.assertNotContains(resp, 'Request Certificate') # Enable certificate generation for this course certs_api.set_cert_generation_enabled(self.course.id, True) resp = views.progress(self.request, course_id=unicode(self.course.id)) - self.assertContains(resp, 'Create Your Certificate') + self.assertNotContains(resp, 'Request Certificate') class VerifyCourseKeyDecoratorTests(TestCase): diff --git a/lms/static/sass/application-extend2.scss.mako b/lms/static/sass/application-extend2.scss.mako index b1ff2a6a21..5969c25e8c 100644 --- a/lms/static/sass/application-extend2.scss.mako +++ b/lms/static/sass/application-extend2.scss.mako @@ -49,6 +49,7 @@ @import 'views/verification'; @import 'views/decoupled-verification'; @import 'views/shoppingcart'; +@import 'course/auto-cert'; // applications @import "discussion/utilities/variables"; diff --git a/lms/static/sass/course/_auto-cert.scss b/lms/static/sass/course/_auto-cert.scss new file mode 100644 index 0000000000..1ab3938fa7 --- /dev/null +++ b/lms/static/sass/course/_auto-cert.scss @@ -0,0 +1,38 @@ +.wrapper-auto-cert { + @include margin(0, 0, 0, 0); // Overrides .wrapper-msg + @include padding(0, 0, 0, 0); // Overrides .wrapper-msg + background: none; // Overrides .wrapper-msg + + .errors-info { + margin-top: $baseline; + margin-bottom: $baseline; + color: $error-color; + } + + .auto-cert-message { + margin: $baseline 0; + padding: $baseline; + border: 1px solid $m-blue-d1; + border-radius: 3px; + background: $m-blue-l4; + + .has-actions { + + .msg-content { + width: flex-grid(9,12); + } + + .msg-actions { + @extend %t-copy-base; + display: inline-block; + width: flex-grid(3,12); + + .btn { + @extend %btn-primary-blue; + @extend %t-weight4; + text-shadow: none; + } + } + } + } +} diff --git a/lms/static/sass/course/_profile.scss b/lms/static/sass/course/_profile.scss index 1a17469326..783e2dcd1b 100644 --- a/lms/static/sass/course/_profile.scss +++ b/lms/static/sass/course/_profile.scss @@ -144,6 +144,16 @@ font-weight: 100; margin: 0; } + + &.progress-certificates { + margin-bottom: 0; + padding-bottom: 0; + border-bottom: none; + + .progress-certificates-title { + float: none; + } + } } #course-success { diff --git a/lms/static/sass/elements/_system-feedback.scss b/lms/static/sass/elements/_system-feedback.scss index ec4e6412de..fb1d04b619 100644 --- a/lms/static/sass/elements/_system-feedback.scss +++ b/lms/static/sass/elements/_system-feedback.scss @@ -52,7 +52,8 @@ width: flex-grid(10,12); } - .nav-actions { + .nav-actions, + .msg-actions { width: flex-grid(2,12); display: inline-block; vertical-align: middle; diff --git a/lms/templates/courseware/progress.html b/lms/templates/courseware/progress.html index d01eb22040..e0e279588c 100644 --- a/lms/templates/courseware/progress.html +++ b/lms/templates/courseware/progress.html @@ -48,34 +48,50 @@ from django.utils.http import urlquote_plus % endif -
-

${_("Course Progress for Student '{username}' ({email})").format(username=student.username, email=student.email)}

+
+

${_("Course Progress for Student '{username}' ({email})").format(username=student.username, email=student.email)}

- %if show_generate_cert_btn: -
- %if passed: - % if is_downloadable and download_url: - - ${_("Download Your Certificate")} - - %elif is_generating: - -

${_("Creating certificate")}

- %else: - + %if show_generate_cert_btn: +
+
+ +
+
+ %if passed: + % if is_downloadable and download_url: +
+

${_("Your certificate is available")}

+

${_("You can now download your certificate as a PDF. If you keep working and receive a higher grade, you can request an updated certificate.")}

+
+ + %elif is_generating: +
+

${_("We're working on it...")}

+

${_("We're creating your certificate. You can keep working in your courses and a link to it will appear here and on your Dashboard when it is ready.")}

+
+
+ %else: +
+

${_("Congratulations, you qualified for a certificate!")}

+

${_("You can keep working for a higher grade, or request your certificate now.")}

+
+
+ +
+ %endif +
%endif - %else: - -

${_("Your certificate will be available when you pass the course.")}

- %endif -
-
- %endif +
+
+ %endif %if not course.disable_progress_graph: - + %endif