From 10cb7f10fa80a597f2246909e2f0b93b728f80fc Mon Sep 17 00:00:00 2001 From: Renzo Lucioni Date: Thu, 8 Jan 2015 16:57:13 -0500 Subject: [PATCH] Fix cosmetic issues with the split payment and verification flow Use honor code ribbon if verification status is not missing, submitted, or approved; title column on payment confirmation page holding dollar amounts more appropriately --- .../student/tests/test_verification_status.py | 14 +++++++++++++ .../dashboard/_dashboard_course_listing.html | 21 ++++++++++++++++--- .../payment_confirmation_step.underscore | 2 +- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/common/djangoapps/student/tests/test_verification_status.py b/common/djangoapps/student/tests/test_verification_status.py index 633762a3c2..39fd885086 100644 --- a/common/djangoapps/student/tests/test_verification_status.py +++ b/common/djangoapps/student/tests/test_verification_status.py @@ -255,6 +255,14 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase): VERIFY_STATUS_APPROVED: ["You have already verified your ID!"], } + MODE_CLASSES = { + None: "honor", + VERIFY_STATUS_NEED_TO_VERIFY: "verified", + VERIFY_STATUS_SUBMITTED: "verified", + VERIFY_STATUS_APPROVED: "verified", + VERIFY_STATUS_MISSED_DEADLINE: "honor" + } + def _assert_course_verification_status(self, status): """Check whether the specified verification status is shown on the dashboard. @@ -274,6 +282,12 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase): # Verify that the correct banner is rendered on the dashboard self.assertContains(response, self.BANNER_ALT_MESSAGES[status]) + # Verify that the correct banner color is rendered + self.assertContains( + response, + "
".format(self.MODE_CLASSES[status]) + ) + # Verify that the correct copy is rendered on the dashboard if status is not None: if status in self.NOTIFICATION_MESSAGES: diff --git a/lms/templates/dashboard/_dashboard_course_listing.html b/lms/templates/dashboard/_dashboard_course_listing.html index 550c36aa46..558dbe3024 100644 --- a/lms/templates/dashboard/_dashboard_course_listing.html +++ b/lms/templates/dashboard/_dashboard_course_listing.html @@ -29,10 +29,25 @@ from student.helpers import (
  • % if settings.FEATURES.get('ENABLE_VERIFIED_CERTIFICATES'): -
    + % if enrollment.mode == "verified": + % if settings.FEATURES.get('SEPARATE_VERIFICATION_FROM_PAYMENT') and request.session.get('separate-verified', False): + % if verification_status.get('status') in [VERIFY_STATUS_NEED_TO_VERIFY, VERIFY_STATUS_SUBMITTED, VERIFY_STATUS_APPROVED]: + <% mode_class = " verified" %> + % else: + <% mode_class = " honor" %> + % endif + % else: + <% mode_class = " verified" %> + % endif + % else: + <% mode_class = " " + enrollment.mode %> + % endif % else: -
    - %endif + <% mode_class = "" %> + % endif + +
    + <% course_target = reverse('info', args=[course.id.to_deprecated_string()]) %> diff --git a/lms/templates/verify_student/payment_confirmation_step.underscore b/lms/templates/verify_student/payment_confirmation_step.underscore index 615f3d57c2..8372442a2a 100644 --- a/lms/templates/verify_student/payment_confirmation_step.underscore +++ b/lms/templates/verify_student/payment_confirmation_step.underscore @@ -18,7 +18,7 @@ <%- gettext( "Order No." ) %> <%- gettext( "Description" ) %> <%- gettext( "Date" ) %> - <%- gettext( "Description" ) %> + <%- gettext( "Amount" ) %>