Commit cb1058ac by chrisndodge

Merge pull request #6142 from edx/muhhshoaib/WL-106-MIT-Course-Information-Page-side-bar

MIT: Course Information Page side bar
parents 70c2adb9 914ecac9
...@@ -322,6 +322,14 @@ class AboutWithClosedEnrollment(ModuleStoreTestCase): ...@@ -322,6 +322,14 @@ class AboutWithClosedEnrollment(ModuleStoreTestCase):
# Check that registration button is not present # Check that registration button is not present
self.assertNotIn(REG_STR, resp.content) self.assertNotIn(REG_STR, resp.content)
def test_course_price_is_not_visble_in_sidebar(self):
url = reverse('about_course', args=[self.course.id.to_deprecated_string()])
resp = self.client.get(url)
self.assertEqual(resp.status_code, 200)
# course price is not visible ihe course_about page when the course
# mode is not set to honor
self.assertNotIn('<span class="important-dates-item-text">$10</span>', resp.content)
@override_settings(MODULESTORE=TEST_DATA_MOCK_MODULESTORE) @override_settings(MODULESTORE=TEST_DATA_MOCK_MODULESTORE)
@patch.dict(settings.FEATURES, {'ENABLE_SHOPPING_CART': True}) @patch.dict(settings.FEATURES, {'ENABLE_SHOPPING_CART': True})
...@@ -421,6 +429,10 @@ class AboutPurchaseCourseTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase): ...@@ -421,6 +429,10 @@ class AboutPurchaseCourseTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
self.assertIn("Enrollment is Closed", resp.content) self.assertIn("Enrollment is Closed", resp.content)
self.assertNotIn("Add buyme to Cart ($10)", resp.content) self.assertNotIn("Add buyme to Cart ($10)", resp.content)
# course price is visible ihe course_about page when the course
# mode is set to honor and it's price is set
self.assertIn('<span class="important-dates-item-text">$10</span>', resp.content)
def test_invitation_only(self): def test_invitation_only(self):
""" """
This makes sure that the invitation only restirction takes prescendence over This makes sure that the invitation only restirction takes prescendence over
......
...@@ -793,6 +793,7 @@ def course_about(request, course_id): ...@@ -793,6 +793,7 @@ def course_about(request, course_id):
'registered': registered, 'registered': registered,
'course_target': course_target, 'course_target': course_target,
'registration_price': registration_price, 'registration_price': registration_price,
'currency_symbol': settings.PAID_COURSE_REGISTRATION_CURRENCY[1],
'in_cart': in_cart, 'in_cart': in_cart,
'reg_then_add_to_cart_link': reg_then_add_to_cart_link, 'reg_then_add_to_cart_link': reg_then_add_to_cart_link,
'show_courseware_link': show_courseware_link, 'show_courseware_link': show_courseware_link,
......
...@@ -311,6 +311,14 @@ ...@@ -311,6 +311,14 @@
##<li class="important-dates-item"><i class="icon icon-time"></i><p class="important-dates-item-title">${_('Course Length')}</p><span class="important-dates-item-text course-length">${_('{number} weeks').format(number=15)}</span></li> ##<li class="important-dates-item"><i class="icon icon-time"></i><p class="important-dates-item-title">${_('Course Length')}</p><span class="important-dates-item-text course-length">${_('{number} weeks').format(number=15)}</span></li>
%if is_shopping_cart_enabled and registration_price:
<li class="important-dates-item">
<i class="icon icon-money"></i>
<p class="important-dates-item-title">${_("Price")}</p>
<span class="important-dates-item-text">${_("{currency_symbol}{cost}").format(currency_symbol=currency_symbol, cost=registration_price)}</span>
</li>
% endif
% if get_course_about_section(course, "prerequisites"): % if get_course_about_section(course, "prerequisites"):
<li class="important-dates-item"><i class="icon icon-book"></i><p class="important-dates-item-title">${_("Prerequisites")}</p><span class="important-dates-item-text prerequisites">${get_course_about_section(course, "prerequisites")}</span></li> <li class="important-dates-item"><i class="icon icon-book"></i><p class="important-dates-item-title">${_("Prerequisites")}</p><span class="important-dates-item-text prerequisites">${get_course_about_section(course, "prerequisites")}</span></li>
% endif % endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment