From cb22b909b6a961ff0e502a092929612cddd438e6 Mon Sep 17 00:00:00 2001 From: Lucky Jindal Date: Mon, 24 Oct 2016 12:27:26 -0400 Subject: [PATCH 1/2] AC-588: Fixed header levels,removed unneccessary element --- lms/static/sass/course/_info.scss | 7 ++++--- lms/templates/courseware/course_updates.html | 11 +++++------ lms/templates/courseware/info.html | 9 +++++---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lms/static/sass/course/_info.scss b/lms/static/sass/course/_info.scss index f834766d82..2d1a57b24f 100644 --- a/lms/static/sass/course/_info.scss +++ b/lms/static/sass/course/_info.scss @@ -48,7 +48,7 @@ div.info-wrapper { width: 100%; display: block; - h1 { + h1,h3 { @include text-align(left); @extend %t-strong; @extend %t-title6; @@ -60,7 +60,7 @@ div.info-wrapper { margin-bottom: lh(); } - > ol,section { + > ol,section,div { list-style: none; margin-bottom: lh(); padding-left: 0; @@ -104,7 +104,7 @@ div.info-wrapper { } } - h2.date { + .date { @extend %t-title9; margin-bottom: ($baseline/4); text-transform: none; @@ -112,6 +112,7 @@ div.info-wrapper { @include padding-left($baseline); @include float(left); } + .toggle-visibility-button { @extend %t-title9; diff --git a/lms/templates/courseware/course_updates.html b/lms/templates/courseware/course_updates.html index 54767db943..4cb983b947 100644 --- a/lms/templates/courseware/course_updates.html +++ b/lms/templates/courseware/course_updates.html @@ -1,11 +1,10 @@ <%! from django.utils.translation import ugettext as _ %> -
-

${_('All course updates')}

+
% for index, update in enumerate(visible_updates):
% if not update.get("is_error"): -

${update.get("date")}

+
${update.get("date")}
% endif
- ${update.get("content")} + ${update.get("content")}
% endfor @@ -35,7 +34,7 @@ -
+
diff --git a/lms/templates/courseware/info.html b/lms/templates/courseware/info.html index 8bf2ae859f..e32d891b22 100644 --- a/lms/templates/courseware/info.html +++ b/lms/templates/courseware/info.html @@ -60,8 +60,9 @@ from openedx.core.djangolib.markup import HTML, Text
-

${_("Welcome to {org}'s {course_name}!").format(org=course.display_org_with_default, course_name=course.display_number_with_default)}

-

${course.display_name_with_default}

+

${_("Welcome to {org}'s {course_name}!").format(org=course.display_org_with_default, course_name=course.display_number_with_default)} +
${course.display_name_with_default}
+

% if last_accessed_courseware_url:
@@ -80,7 +81,7 @@ from openedx.core.djangolib.markup import HTML, Text
% endif -

${_("Course Updates and News")}

+

${_("Course Updates and News")}

${HTML(get_course_info_section(request, masquerade_user, course, 'updates'))} ## CourseTalk widget @@ -93,7 +94,7 @@ from openedx.core.djangolib.markup import HTML, Text
% if SelfPacedConfiguration.current().enable_course_home_improvements: -

${_("Important Course Dates")}

+

${_("Important Course Dates")}

## Should be organized by date, last date appearing at the bottom % for course_date in get_course_date_blocks(course, user): From 282ded7442e6a19c43d8f6edaa44f066fdbd0a86 Mon Sep 17 00:00:00 2001 From: "Albert St. Aubin" Date: Tue, 22 Nov 2016 09:54:28 -0500 Subject: [PATCH 2/2] Addressed test failures and PR comments TNL-5894 --- .../test/acceptance/pages/lms/course_info.py | 2 +- .../courseware/tests/test_course_info.py | 6 +- .../courseware/tests/test_date_summary.py | 4 +- lms/templates/courseware/course_updates.html | 6 +- lms/templates/courseware/info.html | 86 +++++++++---------- 5 files changed, 51 insertions(+), 53 deletions(-) diff --git a/common/test/acceptance/pages/lms/course_info.py b/common/test/acceptance/pages/lms/course_info.py index eb617bc4fe..abb773f439 100644 --- a/common/test/acceptance/pages/lms/course_info.py +++ b/common/test/acceptance/pages/lms/course_info.py @@ -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): diff --git a/lms/djangoapps/courseware/tests/test_course_info.py b/lms/djangoapps/courseware/tests/test_course_info.py index bab762367e..a584ca6948 100644 --- a/lms/djangoapps/courseware/tests/test_course_info.py +++ b/lms/djangoapps/courseware/tests/test_course_info.py @@ -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() ) diff --git a/lms/djangoapps/courseware/tests/test_date_summary.py b/lms/djangoapps/courseware/tests/test_date_summary.py index ec123683b4..edffea818d 100644 --- a/lms/djangoapps/courseware/tests/test_date_summary.py +++ b/lms/djangoapps/courseware/tests/test_date_summary.py @@ -180,7 +180,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase): self.client.login(username='mrrobot', password='test') html_elements = [ - '

Important Course Dates

', + '

Important Course Dates

', '
', '
', '

Important Course Dates

', + '

Important Course Dates

', '
', '
', '

-
% for index, update in enumerate(visible_updates):
% if not update.get("is_error"): -
${update.get("date")}
+
${update.get("date")}
-
diff --git a/lms/templates/courseware/info.html b/lms/templates/courseware/info.html index e32d891b22..7e9b874341 100644 --- a/lms/templates/courseware/info.html +++ b/lms/templates/courseware/info.html @@ -61,7 +61,7 @@ from openedx.core.djangolib.markup import HTML, Text

${_("Welcome to {org}'s {course_name}!").format(org=course.display_org_with_default, course_name=course.display_number_with_default)} -
${course.display_name_with_default}
+
${course.display_name_with_default}

% if last_accessed_courseware_url: @@ -71,14 +71,14 @@ from openedx.core.djangolib.markup import HTML, Text % endif
- % if user.is_authenticated(): + % if user.is_authenticated():
% if studio_url is not None and masquerade and masquerade.role == 'staff': - + % endif

${_("Course Updates and News")}

@@ -86,56 +86,56 @@ from openedx.core.djangolib.markup import HTML, Text ## CourseTalk widget % if show_coursetalk_widget: -
-
-
+
+
+
% endif
+
- % if SelfPacedConfiguration.current().enable_course_home_improvements: -

${_("Important Course Dates")}

- ## Should be organized by date, last date appearing at the bottom + % if SelfPacedConfiguration.current().enable_course_home_improvements: +

${_("Important Course Dates")}

+ ## Should be organized by date, last date appearing at the bottom - % for course_date in get_course_date_blocks(course, user): -
-
- % if course_date.title: - % if course_date.title == 'current_datetime': -

- % else: -

${course_date.title}

+ % for course_date in get_course_date_blocks(course, user): +
+
+ % if course_date.title: + % if course_date.title == 'current_datetime': +

+ % else: +

${course_date.title}

+ % endif % endif - % endif - % if course_date.date and course_date.title != 'current_datetime': -

- % endif - % if course_date.description: -

${course_date.description}

- % endif - % if course_date.link and course_date.link_text: - - ${course_date.link_text} - - % endif + % if course_date.date and course_date.title != 'current_datetime': +

+ % endif + % if course_date.description: +

${course_date.description}

+ % endif + % if course_date.link and course_date.link_text: + + ${course_date.link_text} + + % endif +
-
- % endfor - % endif -

${_(course.info_sidebar_name)}

- ${HTML(get_course_info_section(request, masquerade_user, course, 'handouts'))} + % endfor + % endif +

${_(course.info_sidebar_name)}

+ ${HTML(get_course_info_section(request, masquerade_user, course, 'handouts'))}
- % else: + % else:
-

${_("Course Updates and News")}

+

${_("Course Updates and News")}

${HTML(get_course_info_section(request, masquerade_user, course, 'guest_updates'))}
-

${_("Course Handouts")}

+

${_("Course Handouts")}

${HTML(get_course_info_section(request, masquerade_user, course, 'guest_handouts'))}
- - % endif + % endif