From 3fe8768d93edd2bf887a373a3c56f16964bc93e7 Mon Sep 17 00:00:00 2001 From: marjev Date: Tue, 26 May 2015 12:36:37 +0000 Subject: [PATCH] (SOL-883) RTL support for Registration Code redemption page --- lms/static/sass/views/_shoppingcart.scss | 12 ++- lms/templates/shoppingcart/receipt.html | 2 +- .../registration_code_receipt.html | 89 ++++++++---------- .../registration_code_redemption.html | 94 +++++++++---------- lms/templates/shoppingcart/shopping_cart.html | 6 +- 5 files changed, 93 insertions(+), 110 deletions(-) diff --git a/lms/static/sass/views/_shoppingcart.scss b/lms/static/sass/views/_shoppingcart.scss index 4dd566a0a3..5a9cb3e021 100644 --- a/lms/static/sass/views/_shoppingcart.scss +++ b/lms/static/sass/views/_shoppingcart.scss @@ -284,11 +284,6 @@ $light-border: 1px solid $gray-l5; .image { @include float(left); width: ($baseline*11); - - img { - width: 100%; - height: 100%; - } } .data-input { @@ -988,6 +983,13 @@ $light-border: 1px solid $gray-l5; } } +.course-image, .image { + .item-image { + width: 100%; + height: 100%; + } +} + .empty-cart { @include border-radius(3px); @include text-align(center); diff --git a/lms/templates/shoppingcart/receipt.html b/lms/templates/shoppingcart/receipt.html index cd251234e4..8fa0dad639 100644 --- a/lms/templates/shoppingcart/receipt.html +++ b/lms/templates/shoppingcart/receipt.html @@ -288,7 +288,7 @@ from courseware.courses import course_image_url, get_course_about_section, get_c
- ${course.display_number_with_default | h} ${get_course_about_section(course, 'title')} Image
diff --git a/lms/templates/shoppingcart/registration_code_receipt.html b/lms/templates/shoppingcart/registration_code_receipt.html index 9c1e80b4f1..557873c4c3 100644 --- a/lms/templates/shoppingcart/registration_code_receipt.html +++ b/lms/templates/shoppingcart/registration_code_receipt.html @@ -17,8 +17,11 @@ from courseware.courses import course_image_url, get_course_about_section
- ${course.display_number_with_default | h} ${get_course_about_section(course, 'title')} Cover Image + ${_(
@@ -26,73 +29,63 @@ from courseware.courses import course_image_url, get_course_about_section span_start='', span_end='' )} -
-

${_("{course_name}").format(course_name=course.display_name)} - ${_("{start_date}").format(start_date=course.start_datetime_text())} - ${_("{end_date}").format(end_date=course.end_datetime_text())} + + ${_("{start_date} - {end_date}").format( + start_date=course.start_datetime_text(), + end_date=course.end_datetime_text() + )}


- % if reg_code_already_redeemed:

- ${_("You've clicked a link for an enrollment code that has already been used." - " Check your {link_start}course dashboard{link_end} to see if you're enrolled in the course," - " or contact your company's administrator." - ).format( - link_start=u''.format(url=reverse('dashboard')), - link_end='' - )} + % if reg_code_already_redeemed: + ${_("You've clicked a link for an enrollment code that has already been used." + " Check your {link_start}course dashboard{link_end} to see if you're enrolled in the course," + " or contact your company's administrator." + ).format( + link_start=u''.format(url=reverse('dashboard')), + link_end='' + )} + % elif redemption_success: + ${_("You have successfully enrolled in {course_name}." + " This course has now been added to your dashboard.").format(course_name=course.display_name)} + % elif registered_for_course: + ${_("You're already enrolled for this course." + " Visit your {link_start}dashboard{link_end} to see the course." + ).format( + link_start=u''.format(url=reverse('dashboard')), + link_end='' + )} + % elif course_full: + ${_("The course you are enrolling for is full.")} + % elif enrollment_closed: + ${_("The course you are enrolling for is closed.")} + % elif redeem_code_error: + ${_("There was an error processing your redeem code.")} + % else: + ${_("You're about to activate an enrollment code for {course_name} by {site_name}. " + "This code can only be used one time, so you should only activate this code if you're its intended" + " recipient.").format(course_name=course.display_name, site_name=site_name)} + % endif

- % elif redemption_success: -

- ${_("You have successfully enrolled in {course_name}." - " This course has now been added to your dashboard.").format(course_name=course.display_name)} -

- % elif registered_for_course: -

- ${_("You're already enrolled for this course." - " Visit your {link_start}dashboard{link_end} to see the course." - ).format( - link_start=u''.format(url=reverse('dashboard')), - link_end='' - )} -

- % elif course_full: -

- ${_("The course you are enrolling for is full.")} -

- % elif enrollment_closed: -

- ${_("The course you are enrolling for is closed.")} -

- % elif redeem_code_error: -

- ${_("There was an error processing your redeem code.")} -

- % else: -

- ${_("You're about to activate an enrollment code for {course_name} by {site_name}. " - "This code can only be used one time, so you should only activate this code if you're its intended" - " recipient.").format(course_name=course.display_name, site_name=site_name)} -

- % endif
% if not reg_code_already_redeemed: %if redemption_success: <% course_url = reverse('info', args=[course.id.to_deprecated_string()]) %> - ${_("View Course")} + ${_("View Course")} %elif not registered_for_course:
+ name="active_course_enrollment">${_("Activate Course Enrollment")}
%endif %endif diff --git a/lms/templates/shoppingcart/registration_code_redemption.html b/lms/templates/shoppingcart/registration_code_redemption.html index 8552d9d407..94227732b2 100644 --- a/lms/templates/shoppingcart/registration_code_redemption.html +++ b/lms/templates/shoppingcart/registration_code_redemption.html @@ -17,7 +17,7 @@ from courseware.courses import course_image_url, get_course_about_section
- ${_(
-

${course.display_name} @@ -45,65 +43,57 @@ from courseware.courses import course_image_url, get_course_about_section


- % if reg_code_already_redeemed:

- ${_( - "You've clicked a link for an enrollment code that has already " - "been used. Check your {link_start}course dashboard{link_end} " - "to see if you're enrolled in the course, or contact your " - "company's administrator." - ).format( - link_start=u''.format(url=reverse('dashboard')), - link_end='', - )} + % if reg_code_already_redeemed: + ${_( + "You've clicked a link for an enrollment code that has already " + "been used. Check your {link_start}course dashboard{link_end} " + "to see if you're enrolled in the course, or contact your " + "company's administrator." + ).format( + link_start=u''.format(url=reverse('dashboard')), + link_end='', + )} + % elif redemption_success: + ${_( + "You have successfully enrolled in {course_name}. " + "This course has now been added to your dashboard." + ).format( + course_name=course.display_name, + )} + % elif registered_for_course: + ${_( + "You're already enrolled for this course. " + "Visit your {link_start}dashboard{link_end} to see the course." + ).format( + link_start=u''.format(url=reverse('dashboard')), + link_end='', + )} + % elif redeem_code_error: + ${_( "There was an error processing your redeem code.")} + % else: + ${_( + "You're about to activate an enrollment code for {course_name} " + "by {site_name}. This code can only be used one time, so you " + "should only activate this code if you're its intended " + "recipient." + ).format( + course_name=course.display_name, + site_name=site_name, + )} + % endif

- % elif redemption_success: -

- ${_( - "You have successfully enrolled in {course_name}. " - "This course has now been added to your dashboard." - ).format( - course_name=course.display_name, - )} -

- % elif registered_for_course: -

- ${_( - "You're already enrolled for this course. " - "Visit your {link_start}dashboard{link_end} to see the course." - ).format( - link_start=u''.format(url=reverse('dashboard')), - link_end='', - )} -

- % elif redeem_code_error: -

- ${_( "There was an error processing your redeem code.")} -

- % else: -

- ${_( - "You're about to activate an enrollment code for {course_name} " - "by {site_name}. This code can only be used one time, so you " - "should only activate this code if you're its intended " - "recipient." - ).format( - course_name=course.display_name, - site_name=site_name, - )} -

- % endif
% if not reg_code_already_redeemed: %if redemption_success: - ${_("View Dashboard")} + ${_("View Dashboard")} %elif not registered_for_course:
- + + name="active_course_enrollment">${_("Activate Course Enrollment")}
%endif %endif diff --git a/lms/templates/shoppingcart/shopping_cart.html b/lms/templates/shoppingcart/shopping_cart.html index 2d792d1194..8df06c14ed 100644 --- a/lms/templates/shoppingcart/shopping_cart.html +++ b/lms/templates/shoppingcart/shopping_cart.html @@ -66,10 +66,8 @@ from django.utils.translation import ungettext
- - ${course.display_number_with_default | h} ${get_course_about_section(course, 'title')} ${_('Cover Image')} - + ${course.display_number_with_default | h} ${get_course_about_section(course, 'title')} ${_('Cover Image')}
## Translators: "Registration for:" is followed by a course name