Enable course sidebar for new course home page
LEARNER-764
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
from datetime import datetime
|
||||
from pytz import timezone, utc
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from courseware.courses import get_course_info_section, get_course_date_blocks
|
||||
@@ -113,6 +114,13 @@ from openedx.core.djangolib.markup import HTML, Text
|
||||
</section>
|
||||
|
||||
<section aria-label="${_('Handout Navigation')}" class="handouts">
|
||||
<h3 class="hd hd-3 handouts-header">${_("Course Tools")}</h3>
|
||||
<div>
|
||||
<a class="action-show-bookmarks" href="${reverse('openedx.course_bookmarks.home', args=[course.id])}">
|
||||
<span class="icon fa fa-bookmark" aria-hidden="true"></span>
|
||||
${_("Bookmarks")}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
% if SelfPacedConfiguration.current().enable_course_home_improvements:
|
||||
${HTML(dates_fragment.body_html())}
|
||||
|
||||
@@ -23,13 +23,9 @@ from openedx.features.course_experience import UNIFIED_COURSE_EXPERIENCE_FLAG
|
||||
<header class="page-header has-secondary">
|
||||
<div class="page-header-main">
|
||||
<nav aria-label="${_('Course Outline')}" class="sr-is-focusable" tabindex="-1">
|
||||
% if waffle.flag_is_active(request, UNIFIED_COURSE_EXPERIENCE_FLAG):
|
||||
<h2 class="hd hd-3 page-title">
|
||||
${_("{course_name}").format(org=course.display_org_with_default, course_name=course.display_name_with_default)}
|
||||
</h2>
|
||||
% else:
|
||||
<h2 class="hd hd-2 page-title">${_('Course Outline')}</h2>
|
||||
% endif
|
||||
<h2 class="hd hd-3 page-title">
|
||||
${_("{course_name}").format(org=course.display_org_with_default, course_name=course.display_name_with_default)}
|
||||
</h2>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="page-header-secondary">
|
||||
@@ -49,11 +45,6 @@ from openedx.features.course_experience import UNIFIED_COURSE_EXPERIENCE_FLAG
|
||||
</div>
|
||||
% endif
|
||||
<div class="form-actions">
|
||||
% if not waffle.flag_is_active(request, UNIFIED_COURSE_EXPERIENCE_FLAG):
|
||||
<a class="btn action-show-bookmarks" href="${reverse('openedx.course_bookmarks.home', args=[course_key])}">
|
||||
${_("Bookmarks")}
|
||||
</a>
|
||||
% endif
|
||||
% if resume_course_url:
|
||||
<a class="btn btn-brand action-resume-course" href="${resume_course_url}">
|
||||
% if has_visited_course:
|
||||
@@ -67,43 +58,41 @@ from openedx.features.course_experience import UNIFIED_COURSE_EXPERIENCE_FLAG
|
||||
</div>
|
||||
</header>
|
||||
<div class="page-content">
|
||||
% if waffle.flag_is_active(request, UNIFIED_COURSE_EXPERIENCE_FLAG):
|
||||
<div class="layout layout-1q3q">
|
||||
<main class="layout-col layout-col-b">
|
||||
${HTML(outline_fragment.body_html())}
|
||||
</main>
|
||||
<aside class="course-sidebar layout-col layout-col-a">
|
||||
<div class="section section-tools">
|
||||
<h3 class="hd-6">${_("Course Tools")}</h3>
|
||||
<ul class="list-unstyled">
|
||||
<div class="layout layout-1q3q">
|
||||
<main class="layout-col layout-col-b">
|
||||
${HTML(outline_fragment.body_html())}
|
||||
</main>
|
||||
<aside class="course-sidebar layout-col layout-col-a">
|
||||
<div class="section section-tools">
|
||||
<h3 class="hd-6">${_("Course Tools")}</h3>
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
<a href="${reverse('openedx.course_bookmarks.home', args=[course_key])}">
|
||||
<span class="icon fa fa-bookmark" aria-hidden="true"></span>
|
||||
${_("Bookmarks")}
|
||||
</a>
|
||||
</li>
|
||||
% if waffle.flag_is_active(request, UNIFIED_COURSE_EXPERIENCE_FLAG):
|
||||
<li>
|
||||
<a class="action-show-bookmarks" href="${reverse('openedx.course_bookmarks.home', args=[course_key])}">
|
||||
<span class="icon fa fa-bookmark" aria-hidden="true"></span>
|
||||
${_("Bookmarks")}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="action-show-bookmarks" href="${reverse('openedx.course_experience.course_updates', args=[course.id])}">
|
||||
<a href="${reverse('openedx.course_experience.course_updates', args=[course.id])}">
|
||||
<span class="icon fa fa-newspaper-o" aria-hidden="true"></span>
|
||||
${_("Updates")}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
% endif
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section section-dates">
|
||||
${HTML(dates_fragment.body_html())}
|
||||
</div>
|
||||
% if handouts_html:
|
||||
<div class="section section-handouts">
|
||||
<h3 class="hd-6">${_("Course Handouts")}</h3>
|
||||
${HTML(handouts_html)}
|
||||
</div>
|
||||
<div class="section section-dates">
|
||||
${HTML(dates_fragment.body_html())}
|
||||
</div>
|
||||
% if handouts_html:
|
||||
<div class="section section-handouts">
|
||||
<h3 class="hd-6">${_("Course Handouts")}</h3>
|
||||
${HTML(handouts_html)}
|
||||
</div>
|
||||
% endif
|
||||
</aside>
|
||||
</div>
|
||||
% else:
|
||||
${HTML(outline_fragment.body_html())}
|
||||
% endif
|
||||
% endif
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</%block>
|
||||
|
||||
@@ -65,7 +65,7 @@ class TestCourseHomePage(SharedModuleStoreTestCase):
|
||||
get_course_in_cache(self.course.id)
|
||||
|
||||
# Fetch the view and verify the query counts
|
||||
with self.assertNumQueries(37):
|
||||
with self.assertNumQueries(35):
|
||||
with check_mongo_calls(3):
|
||||
url = course_home_url(self.course)
|
||||
self.client.get(url)
|
||||
|
||||
Reference in New Issue
Block a user