From 700eb8b702aca3302363d64c16f40138dce4fbd2 Mon Sep 17 00:00:00 2001 From: Matt Drayer Date: Thu, 25 Jun 2015 14:49:40 -0400 Subject: [PATCH] mattdrayer/fix-progress/template: Improved web certificates support --- lms/djangoapps/courseware/tests/test_views.py | 3 +- lms/templates/courseware/progress.html | 90 +++++++++---------- 2 files changed, 45 insertions(+), 48 deletions(-) diff --git a/lms/djangoapps/courseware/tests/test_views.py b/lms/djangoapps/courseware/tests/test_views.py index 217da31f53..59630b0feb 100644 --- a/lms/djangoapps/courseware/tests/test_views.py +++ b/lms/djangoapps/courseware/tests/test_views.py @@ -858,7 +858,8 @@ class ProgressPageTests(ModuleStoreTestCase): resp = views.progress(self.request, course_id=unicode(self.course.id)) self.assertContains(resp, u"View Certificate") - self.assertContains(resp, u"You can now view your certificate") + + self.assertContains(resp, u"You can now access your certificate") cert_url = certs_api.get_certificate_url( user_id=self.user.id, course_id=self.course.id, diff --git a/lms/templates/courseware/progress.html b/lms/templates/courseware/progress.html index 5ceac475e1..3ac56971f4 100644 --- a/lms/templates/courseware/progress.html +++ b/lms/templates/courseware/progress.html @@ -48,56 +48,52 @@ from django.utils.http import urlquote_plus

${_("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: - -
-

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

- %if show_cert_web_view: -

${_("You can now view your certificate.")}

- %else: -

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

- %endif -
-
- %if show_cert_web_view: - - ${_("View Certificate")} - - %else: - - ${_("Download Your Certificate")} - - %endif -
- %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 -
-
+ %if show_generate_cert_btn: +
+
+ %if passed: +
+
+ <% post_url = reverse('generate_user_cert', args=[unicode(course.id)]) %> + % if is_downloadable: +
+

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

+

+ ${_("You can now access your certificate. If you keep working and receive a higher grade,you can request an {link_start} updated certificate {link_end}.").format( + link_start=u"".format(post_url), link_end=u"")} +

+
+
+ %if show_cert_web_view and cert_web_view_url: + + ${_("View Certificate")} + + %elif download_url: + + ${_("Download Your Certificate")} + %endif +
+ %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 +
+ %endif %if not course.disable_progress_graph: