Hide '<- Outline >' link in breadcrumbs if using old course view

This commit is contained in:
Brian Jacobel
2017-03-09 14:03:15 -05:00
committed by Diana Huang
parent a3f32fea5a
commit 574d070392
4 changed files with 17 additions and 9 deletions

View File

@@ -274,7 +274,8 @@
edx.HtmlUtils.template($('#sequence-breadcrumbs-tpl').text())({
courseId: this.el.parent().data('course-id'),
blockId: this.id,
pathText: this.el.find('.nav-item.active').data('path')
pathText: this.el.find('.nav-item.active').data('path'),
unifiedCourseView: this.path.data('unified-course-view')
})
);

View File

@@ -1,7 +1,9 @@
<a href="<%- '/courses/' + courseId + '/course/#' + blockId %>">
<span class="fa fa-arrow-circle-left" aria-hidden="true" aria-describedby="outline-description"></span>
<span class="sr-only" id="outline-description"><%- gettext('Return to course outline') %></span>
<b><%- gettext('Outline') %></b>
</a>
<span> > </span>
<% if (unifiedCourseView) { %>
<a href="<%- '/courses/' + courseId + '/course/#' + blockId %>">
<span class="fa fa-arrow-circle-left" aria-hidden="true" aria-describedby="outline-description"></span>
<span class="sr-only" id="outline-description"><%- gettext('Return to course outline') %></span>
<b><%- gettext('Outline') %></b>
</a>
<span> > </span>
<% } %>
<span class="position"><%- pathText %></span>

View File

@@ -3,6 +3,8 @@
<%namespace name='static' file='/static_content.html'/>
<%def name="online_help_token()"><% return "courseware" %></%def>
<%!
import waffle
from django.utils.translation import ugettext as _
from django.conf import settings
@@ -152,7 +154,10 @@ ${HTML(fragment.foot_html())}
% endif
<section class="course-content" id="course-content">
<main id="main" tabindex="-1" aria-label="Content">
<div class="path"></div>
<div
class="path"
data-unified-course-view="${'true' if waffle.flag_is_active(request, 'unified_course_view') else 'false'}"
></div>
% if getattr(course, 'entrance_exam_enabled') and \
getattr(course, 'entrance_exam_minimum_score_pct') and \
entrance_exam_current_score is not UNDEFINED:

View File

@@ -6,7 +6,7 @@
from django.utils.translation import ugettext as _
%>
<%static:require_module_async module_name="js/courseware/course_outline_factory" class_name="CourseOutlineFactory">
<%static:require_module_async module_name="course_experience/js/course_outline_factory" class_name="CourseOutlineFactory">
CourseOutlineFactory('.block-tree');
</%static:require_module_async>