Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
eca83ba7
Commit
eca83ba7
authored
Feb 07, 2017
by
Brian Jacobel
Committed by
Diana Huang
Mar 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Outline will only show section and subsection, not unit
parent
74b789b6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
14 deletions
+43
-14
lms/envs/common.py
+1
-0
lms/static/js/courseware/course_outline_factory.js
+29
-0
lms/templates/courseware/course-outline.html
+11
-14
requirements/edx/base.txt
+2
-0
No files found.
lms/envs/common.py
View file @
eca83ba7
...
...
@@ -1736,6 +1736,7 @@ REQUIRE_JS_PATH_OVERRIDES = {
'js/student_account/logistration_factory'
:
'js/student_account/logistration_factory.js'
,
'js/student_profile/views/learner_profile_factory'
:
'js/student_profile/views/learner_profile_factory.js'
,
'js/courseware/courseware_factory'
:
'js/courseware/courseware_factory.js'
,
'js/courseware/course_outline_factory'
:
'js/courseware/course_outline_factory.js'
,
'js/groups/views/cohorts_dashboard_factory'
:
'js/groups/views/cohorts_dashboard_factory.js'
,
'draggabilly'
:
'js/vendor/draggabilly.js'
}
...
...
lms/static/js/courseware/course_outline_factory.js
0 → 100644
View file @
eca83ba7
(
function
(
define
)
{
'use strict'
;
define
([
'jquery'
,
'edx-ui-toolkit/js/utils/constants'
],
function
(
$
,
constants
)
{
return
function
(
root
)
{
// In the future this factory could instantiate a Backbone view or React component that handles events
$
(
root
).
keydown
(
function
(
event
)
{
var
$focusable
=
$
(
'.outline-item.focusable'
),
currentFocusIndex
=
$
.
inArray
(
event
.
target
,
$focusable
);
switch
(
event
.
keyCode
)
{
// eslint-disable-line default-case
case
constants
.
keyCodes
.
down
:
event
.
preventDefault
();
$focusable
.
eq
(
Math
.
min
(
currentFocusIndex
+
1
,
$focusable
.
length
-
1
)).
focus
();
break
;
case
constants
.
keyCodes
.
up
:
event
.
preventDefault
();
$focusable
.
eq
(
Math
.
max
(
currentFocusIndex
-
1
,
0
)).
focus
();
break
;
}
});
};
}
);
}).
call
(
this
,
define
||
RequireJS
.
define
);
lms/templates/courseware/course-outline.html
View file @
eca83ba7
...
...
@@ -3,23 +3,20 @@
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%!
import
json
import
pprint
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<section
class=
"course-outline"
id=
"course-outline"
>
<ul>
% for unit in blocks.get('children') or []:
<li>
${ unit['display_name'] }
</li>
<ul>
% for section in unit.get('children') or []:
<li>
${ section['display_name'] }
</li>
<ul>
% for subsection in section.get('children') or []:
<li>
${ subsection['display_name'] }
</li>
% endfor
</ul>
<
%
static:require_module_async
module_name=
"js/courseware/course_outline_factory"
class_name=
"CourseOutlineFactory"
>
CourseOutlineFactory('.block-tree');
</
%
static:require
_module_async
>
<section
class=
"course-outline"
id=
"main"
>
<ul
class=
"block-tree"
role=
"tree"
>
% for section in blocks.get('children') or []:
<li
class=
"outline-item focusable"
role=
"treeitem"
tabindex=
"0"
aria-expanded=
"true"
>
${ section['display_name'] }
</li>
<ul
class=
"outline-item focusable"
role=
"group"
tabindex=
"0"
>
% for subsection in section.get('children') or []:
<li
class=
"outline-item focusable"
role=
"treeitem"
tabindex=
"0"
aria-expanded=
"true"
>
${ subsection['display_name'] }
</li>
% endfor
</ul>
% endfor
...
...
requirements/edx/base.txt
View file @
eca83ba7
...
...
@@ -111,7 +111,9 @@ django-ratelimit-backend==1.0
unicodecsv==0.9.4
django-require==1.0.11
pyuca==1.1
web-fragments==0.1.0
wrapt==1.10.5
XBlock==0.4.14
zendesk==1.1.1
# This needs to be installed *after* Cython, which is in pre.txt
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment