Commit be7f6ecb by Albert (AJ) St. Aubin Committed by GitHub

Merge pull request #14036 from edx/aj/AC588_TNL-5894

Aj/ac588 tnl 5894
parents 69cd7385 282ded74
...@@ -20,7 +20,7 @@ class CourseInfoPage(CoursePage): ...@@ -20,7 +20,7 @@ class CourseInfoPage(CoursePage):
""" """
Return the number of updates on the page. 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 @property
def handout_links(self): def handout_links(self):
......
...@@ -216,15 +216,15 @@ class CourseInfoTitleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase): ...@@ -216,15 +216,15 @@ class CourseInfoTitleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
) )
self.assertIn( self.assertIn(
expected_title, expected_title,
content('h1.page-title').contents() content('.page-title').contents()[0]
) )
self.assertIn( self.assertIn(
expected_display_title, expected_display_title,
display_content('h1.page-title').contents() display_content('.page-title').contents()[0]
) )
self.assertIn( self.assertIn(
display_course.display_name_with_default, display_course.display_name_with_default,
display_content('h2.page-subtitle').contents() display_content('.page-subtitle').contents()
) )
......
...@@ -180,7 +180,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase): ...@@ -180,7 +180,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase):
self.client.login(username='mrrobot', password='test') self.client.login(username='mrrobot', password='test')
html_elements = [ 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-container">',
'<div class="date-summary date-summary-todays-date">', '<div class="date-summary date-summary-todays-date">',
'<h3 class="heading localized-datetime"', '<h3 class="heading localized-datetime"',
...@@ -202,7 +202,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase): ...@@ -202,7 +202,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase):
response = self.client.get(url) response = self.client.get(url)
html_elements = [ 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-container">',
'<div class="date-summary date-summary-todays-date">', '<div class="date-summary date-summary-todays-date">',
'<h3 class="heading localized-datetime"', '<h3 class="heading localized-datetime"',
......
...@@ -48,7 +48,7 @@ div.info-wrapper { ...@@ -48,7 +48,7 @@ div.info-wrapper {
width: 100%; width: 100%;
display: block; display: block;
h1 { h1,h3 {
@include text-align(left); @include text-align(left);
@extend %t-strong; @extend %t-strong;
@extend %t-title6; @extend %t-title6;
...@@ -60,7 +60,7 @@ div.info-wrapper { ...@@ -60,7 +60,7 @@ div.info-wrapper {
margin-bottom: lh(); margin-bottom: lh();
} }
> ol,section { > ol,section,div {
list-style: none; list-style: none;
margin-bottom: lh(); margin-bottom: lh();
padding-left: 0; padding-left: 0;
...@@ -104,7 +104,7 @@ div.info-wrapper { ...@@ -104,7 +104,7 @@ div.info-wrapper {
} }
} }
h2.date { .date {
@extend %t-title9; @extend %t-title9;
margin-bottom: ($baseline/4); margin-bottom: ($baseline/4);
text-transform: none; text-transform: none;
...@@ -112,6 +112,7 @@ div.info-wrapper { ...@@ -112,6 +112,7 @@ div.info-wrapper {
@include padding-left($baseline); @include padding-left($baseline);
@include float(left); @include float(left);
} }
.toggle-visibility-button { .toggle-visibility-button {
@extend %t-title9; @extend %t-title9;
......
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<section aria-labelledby="course-updates-heading">
<h2 class="hd hd-2 sr" id="course-updates-heading">${_('All course updates')}</h2>
<div class="recent-updates"> <div class="recent-updates">
% for index, update in enumerate(visible_updates): % for index, update in enumerate(visible_updates):
<article class="updates-article"> <article class="updates-article">
% if not update.get("is_error"): % if not update.get("is_error"):
<h2 class="date" id="msg-date-${index}">${update.get("date")}</h2> <h5 class="date" id="msg-date-${index}">${update.get("date")}</h5>
<button <button
class="toggle-visibility-button" class="toggle-visibility-button"
data-hide="${_('Hide')}" data-hide="${_('Hide')}"
...@@ -16,7 +14,7 @@ ...@@ -16,7 +14,7 @@
></button> ></button>
% endif % endif
<div class="toggle-visibility-element article-content ${'hidden' if index >= 1 else ''}" id="msg-content-${index}"> <div class="toggle-visibility-element article-content ${'hidden' if index >= 1 else ''}" id="msg-content-${index}">
${update.get("content")} ${update.get("content")}
</div> </div>
</article> </article>
% endfor % endfor
...@@ -35,7 +33,7 @@ ...@@ -35,7 +33,7 @@
<div class="old-updates hidden toggle-visibility-element" id="old-updates"> <div class="old-updates hidden toggle-visibility-element" id="old-updates">
% for index, update in enumerate(hidden_updates): % for index, update in enumerate(hidden_updates):
<article class="updates-article"> <article class="updates-article">
<h2 class="date" id="msg-date-${index + len(visible_updates)}">${update.get("date")}</h2> <h5 class="date" id="msg-date-${index + len(visible_updates)}">${update.get("date")}</h5>
<button <button
class="toggle-visibility-button" class="toggle-visibility-button"
data-hide="${_('Hide')}" data-hide="${_('Hide')}"
...@@ -48,4 +46,3 @@ ...@@ -48,4 +46,3 @@
</article> </article>
% endfor % endfor
</div> </div>
</section>
...@@ -60,8 +60,9 @@ from openedx.core.djangolib.markup import HTML, Text ...@@ -60,8 +60,9 @@ from openedx.core.djangolib.markup import HTML, Text
<div class="container"> <div class="container">
<div class="home"> <div class="home">
<div class="page-header-main"> <div class="page-header-main">
<h1 class="page-title">${_("Welcome to {org}'s {course_name}!").format(org=course.display_org_with_default, course_name=course.display_number_with_default)}</h1> <h3 class="page-title">${_("Welcome to {org}'s {course_name}!").format(org=course.display_org_with_default, course_name=course.display_number_with_default)}
<h2 class="page-subtitle">${course.display_name_with_default}</h2> <div class="page-subtitle">${course.display_name_with_default}</div>
</h3>
</div> </div>
% if last_accessed_courseware_url: % if last_accessed_courseware_url:
<div class="page-header-secondary"> <div class="page-header-secondary">
...@@ -70,71 +71,71 @@ from openedx.core.djangolib.markup import HTML, Text ...@@ -70,71 +71,71 @@ from openedx.core.djangolib.markup import HTML, Text
% endif % endif
</div> </div>
<div class="info-wrapper"> <div class="info-wrapper">
% if user.is_authenticated(): % if user.is_authenticated():
<section class="updates"> <section class="updates">
% if studio_url is not None and masquerade and masquerade.role == 'staff': % if studio_url is not None and masquerade and masquerade.role == 'staff':
<div class="wrap-instructor-info studio-view"> <div class="wrap-instructor-info studio-view">
<a class="instructor-info-action" href="${studio_url}"> <a class="instructor-info-action" href="${studio_url}">
${_("View Updates in Studio")} ${_("View Updates in Studio")}
</a> </a>
</div> </div>
% endif % endif
<h1>${_("Course Updates and News")}</h1> <h4>${_("Course Updates and News")}</h4>
${HTML(get_course_info_section(request, masquerade_user, course, 'updates'))} ${HTML(get_course_info_section(request, masquerade_user, course, 'updates'))}
## CourseTalk widget ## CourseTalk widget
% if show_coursetalk_widget: % if show_coursetalk_widget:
<div class="coursetalk-write-reviews"> <div class="coursetalk-write-reviews">
<div id="ct-custom-read-review-widget" data-provider="${platform_key}" data-course="${course_review_key}"></div> <div id="ct-custom-read-review-widget" data-provider="${platform_key}" data-course="${course_review_key}"></div>
</div> </div>
% endif % endif
</section> </section>
<section aria-label="${_('Handout Navigation')}" class="handouts"> <section aria-label="${_('Handout Navigation')}" class="handouts">
% if SelfPacedConfiguration.current().enable_course_home_improvements: % if SelfPacedConfiguration.current().enable_course_home_improvements:
<h1 class="handouts-header">${_("Important Course Dates")}</h1> <h4 class="handouts-header">${_("Important Course Dates")}</h4>
## Should be organized by date, last date appearing at the bottom ## Should be organized by date, last date appearing at the bottom
% for course_date in get_course_date_blocks(course, user): % for course_date in get_course_date_blocks(course, user):
<div class="date-summary-container"> <div class="date-summary-container">
<div class="date-summary date-summary-${course_date.css_class}"> <div class="date-summary date-summary-${course_date.css_class}">
% if course_date.title: % if course_date.title:
% if course_date.title == 'current_datetime': % 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> <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: % else:
<h3 class="heading">${course_date.title}</h3> <h3 class="heading">${course_date.title}</h3>
% 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 % endif
% endif % if course_date.description:
% if course_date.date and course_date.title != 'current_datetime': <p class="description">${course_date.description}</p>
<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
% endif % if course_date.link and course_date.link_text:
% if course_date.description: <span class="date-summary-link">
<p class="description">${course_date.description}</p> <a href="${course_date.link}">${course_date.link_text}</a>
% endif </span>
% if course_date.link and course_date.link_text: % endif
<span class="date-summary-link"> </div>
<a href="${course_date.link}">${course_date.link_text}</a>
</span>
% endif
</div> </div>
</div> % endfor
% endfor % endif
% endif <h4 class="handouts-header">${_(course.info_sidebar_name)}</h4>
<h1 class="handouts-header">${_(course.info_sidebar_name)}</h1> ${HTML(get_course_info_section(request, masquerade_user, course, 'handouts'))}
${HTML(get_course_info_section(request, masquerade_user, course, 'handouts'))}
</section> </section>
% else: % else:
<section class="updates"> <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'))} ${HTML(get_course_info_section(request, masquerade_user, course, 'guest_updates'))}
</section> </section>
<section aria-label="${_('Handout Navigation')}" class="handouts"> <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'))} ${HTML(get_course_info_section(request, masquerade_user, course, 'guest_handouts'))}
</section> </section>
% endif <!-- if course authenticated -->
% endif
</div> </div>
</div> </div>
</main> </main>
......
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