Addressed test failures and PR comments
TNL-5894
This commit is contained in:
@@ -20,7 +20,7 @@ class CourseInfoPage(CoursePage):
|
||||
"""
|
||||
Return the number of updates on the page.
|
||||
"""
|
||||
return len(self.q(css='section.updates section article').results)
|
||||
return len(self.q(css='.updates .updates-article').results)
|
||||
|
||||
@property
|
||||
def handout_links(self):
|
||||
|
||||
@@ -216,15 +216,15 @@ class CourseInfoTitleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
)
|
||||
self.assertIn(
|
||||
expected_title,
|
||||
content('h1.page-title').contents()
|
||||
content('.page-title').contents()[0]
|
||||
)
|
||||
self.assertIn(
|
||||
expected_display_title,
|
||||
display_content('h1.page-title').contents()
|
||||
display_content('.page-title').contents()[0]
|
||||
)
|
||||
self.assertIn(
|
||||
display_course.display_name_with_default,
|
||||
display_content('h2.page-subtitle').contents()
|
||||
display_content('.page-subtitle').contents()
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase):
|
||||
self.client.login(username='mrrobot', password='test')
|
||||
|
||||
html_elements = [
|
||||
'<h1 class="handouts-header">Important Course Dates</h1>',
|
||||
'<h4 class="handouts-header">Important Course Dates</h4>',
|
||||
'<div class="date-summary-container">',
|
||||
'<div class="date-summary date-summary-todays-date">',
|
||||
'<h3 class="heading localized-datetime"',
|
||||
@@ -202,7 +202,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase):
|
||||
response = self.client.get(url)
|
||||
|
||||
html_elements = [
|
||||
'<h1 class="handouts-header">Important Course Dates</h1>',
|
||||
'<h4 class="handouts-header">Important Course Dates</h4>',
|
||||
'<div class="date-summary-container">',
|
||||
'<div class="date-summary date-summary-todays-date">',
|
||||
'<h3 class="heading localized-datetime"',
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<%! from django.utils.translation import ugettext as _ %>
|
||||
<div>
|
||||
<div class="recent-updates">
|
||||
% for index, update in enumerate(visible_updates):
|
||||
<article class="updates-article">
|
||||
% if not update.get("is_error"):
|
||||
<div class="date" id="msg-date-${index}">${update.get("date")}</div>
|
||||
<h5 class="date" id="msg-date-${index}">${update.get("date")}</h5>
|
||||
<button
|
||||
class="toggle-visibility-button"
|
||||
data-hide="${_('Hide')}"
|
||||
@@ -34,7 +33,7 @@
|
||||
<div class="old-updates hidden toggle-visibility-element" id="old-updates">
|
||||
% for index, update in enumerate(hidden_updates):
|
||||
<article class="updates-article">
|
||||
<div class="date" id="msg-date-${index + len(visible_updates)}">${update.get("date")}</div>
|
||||
<h5 class="date" id="msg-date-${index + len(visible_updates)}">${update.get("date")}</h5>
|
||||
<button
|
||||
class="toggle-visibility-button"
|
||||
data-hide="${_('Hide')}"
|
||||
@@ -47,4 +46,3 @@
|
||||
</article>
|
||||
% endfor
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -61,7 +61,7 @@ from openedx.core.djangolib.markup import HTML, Text
|
||||
<div class="home">
|
||||
<div class="page-header-main">
|
||||
<h3 class="page-title">${_("Welcome to {org}'s {course_name}!").format(org=course.display_org_with_default, course_name=course.display_number_with_default)}
|
||||
<div class="page-subtitle">${course.display_name_with_default}</div>
|
||||
<div class="page-subtitle">${course.display_name_with_default}</div>
|
||||
</h3>
|
||||
</div>
|
||||
% if last_accessed_courseware_url:
|
||||
@@ -71,14 +71,14 @@ from openedx.core.djangolib.markup import HTML, Text
|
||||
% endif
|
||||
</div>
|
||||
<div class="info-wrapper">
|
||||
% if user.is_authenticated():
|
||||
% if user.is_authenticated():
|
||||
<section class="updates">
|
||||
% if studio_url is not None and masquerade and masquerade.role == 'staff':
|
||||
<div class="wrap-instructor-info studio-view">
|
||||
<a class="instructor-info-action" href="${studio_url}">
|
||||
${_("View Updates in Studio")}
|
||||
</a>
|
||||
</div>
|
||||
<div class="wrap-instructor-info studio-view">
|
||||
<a class="instructor-info-action" href="${studio_url}">
|
||||
${_("View Updates in Studio")}
|
||||
</a>
|
||||
</div>
|
||||
% endif
|
||||
|
||||
<h4>${_("Course Updates and News")}</h4>
|
||||
@@ -86,56 +86,56 @@ from openedx.core.djangolib.markup import HTML, Text
|
||||
|
||||
## CourseTalk widget
|
||||
% if show_coursetalk_widget:
|
||||
<div class="coursetalk-write-reviews">
|
||||
<div id="ct-custom-read-review-widget" data-provider="${platform_key}" data-course="${course_review_key}"></div>
|
||||
</div>
|
||||
<div class="coursetalk-write-reviews">
|
||||
<div id="ct-custom-read-review-widget" data-provider="${platform_key}" data-course="${course_review_key}"></div>
|
||||
</div>
|
||||
% endif
|
||||
</section>
|
||||
|
||||
<section aria-label="${_('Handout Navigation')}" class="handouts">
|
||||
|
||||
% if SelfPacedConfiguration.current().enable_course_home_improvements:
|
||||
<h4 class="handouts-header">${_("Important Course Dates")}</h1>
|
||||
## Should be organized by date, last date appearing at the bottom
|
||||
% if SelfPacedConfiguration.current().enable_course_home_improvements:
|
||||
<h4 class="handouts-header">${_("Important Course Dates")}</h4>
|
||||
## Should be organized by date, last date appearing at the bottom
|
||||
|
||||
% for course_date in get_course_date_blocks(course, user):
|
||||
<div class="date-summary-container">
|
||||
<div class="date-summary date-summary-${course_date.css_class}">
|
||||
% if course_date.title:
|
||||
% if course_date.title == 'current_datetime':
|
||||
<h3 class="heading localized-datetime" data-datetime="${course_date.date}" data-string="${_(u'Today is {date}')}" data-timezone="${user_timezone}" data-language="${user_language}"></h3>
|
||||
% else:
|
||||
<h3 class="heading">${course_date.title}</h3>
|
||||
% for course_date in get_course_date_blocks(course, user):
|
||||
<div class="date-summary-container">
|
||||
<div class="date-summary date-summary-${course_date.css_class}">
|
||||
% if course_date.title:
|
||||
% if course_date.title == 'current_datetime':
|
||||
<h3 class="heading localized-datetime" data-datetime="${course_date.date}" data-string="${_(u'Today is {date}')}" data-timezone="${user_timezone}" data-language="${user_language}"></h3>
|
||||
% else:
|
||||
<h3 class="heading">${course_date.title}</h3>
|
||||
% endif
|
||||
% endif
|
||||
% endif
|
||||
% if course_date.date and course_date.title != 'current_datetime':
|
||||
<h4 class="date localized-datetime" data-format="shortDate" data-datetime="${course_date.date}" data-timezone="${user_timezone}" data-language="${user_language}" data-string="${_(course_date.relative_datestring)}"></h4>
|
||||
% endif
|
||||
% if course_date.description:
|
||||
<p class="description">${course_date.description}</p>
|
||||
% endif
|
||||
% if course_date.link and course_date.link_text:
|
||||
<span class="date-summary-link">
|
||||
<a href="${course_date.link}">${course_date.link_text}</a>
|
||||
</span>
|
||||
% endif
|
||||
% if course_date.date and course_date.title != 'current_datetime':
|
||||
<h4 class="date localized-datetime" data-format="shortDate" data-datetime="${course_date.date}" data-timezone="${user_timezone}" data-language="${user_language}" data-string="${_(course_date.relative_datestring)}"></h4>
|
||||
% endif
|
||||
% if course_date.description:
|
||||
<p class="description">${course_date.description}</p>
|
||||
% endif
|
||||
% if course_date.link and course_date.link_text:
|
||||
<span class="date-summary-link">
|
||||
<a href="${course_date.link}">${course_date.link_text}</a>
|
||||
</span>
|
||||
% endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
% endfor
|
||||
% endif
|
||||
<h1 class="handouts-header">${_(course.info_sidebar_name)}</h1>
|
||||
${HTML(get_course_info_section(request, masquerade_user, course, 'handouts'))}
|
||||
% endfor
|
||||
% endif
|
||||
<h4 class="handouts-header">${_(course.info_sidebar_name)}</h4>
|
||||
${HTML(get_course_info_section(request, masquerade_user, course, 'handouts'))}
|
||||
</section>
|
||||
% else:
|
||||
% else:
|
||||
<section class="updates">
|
||||
<h1 class="handouts-header">${_("Course Updates and News")}</h1>
|
||||
<h4 class="handouts-header">${_("Course Updates and News")}</h4>
|
||||
${HTML(get_course_info_section(request, masquerade_user, course, 'guest_updates'))}
|
||||
</section>
|
||||
<section aria-label="${_('Handout Navigation')}" class="handouts">
|
||||
<h1 class="handouts-header">${_("Course Handouts")}</h1>
|
||||
<h4 class="handouts-header">${_("Course Handouts")}</h4>
|
||||
${HTML(get_course_info_section(request, masquerade_user, course, 'guest_handouts'))}
|
||||
</section>
|
||||
|
||||
% endif
|
||||
% endif <!-- if course authenticated -->
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user