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
25229a74
Commit
25229a74
authored
Apr 24, 2017
by
Andy Armstrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement course handouts
LEARNER-607
parent
e7e7b3bc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
6 deletions
+24
-6
lms/djangoapps/courseware/courses.py
+1
-1
lms/static/sass/features/_course-outline.scss
+0
-2
lms/static/sass/shared-v2/_components.scss
+4
-0
openedx/features/course_experience/__init__.py
+5
-1
openedx/features/course_experience/templates/course_experience/course-home-fragment.html
+9
-1
openedx/features/course_experience/views/course_home.py
+5
-1
No files found.
lms/djangoapps/courseware/courses.py
View file @
25229a74
...
...
@@ -278,7 +278,7 @@ def get_course_info_section(request, user, course, section_key):
html
=
''
if
info_module
is
not
None
:
try
:
html
=
info_module
.
render
(
STUDENT_VIEW
)
.
content
html
=
info_module
.
render
(
STUDENT_VIEW
)
.
content
.
strip
()
except
Exception
:
# pylint: disable=broad-except
html
=
render_to_string
(
'courseware/error-message.html'
,
None
)
log
.
exception
(
...
...
lms/static/sass/features/_course-outline.scss
View file @
25229a74
...
...
@@ -11,8 +11,6 @@
padding
:
0
(
$baseline
*
2
);
&
:not
(
:first-child
)
{
border-top
:
1px
solid
$lms-border-color
;
.section-name
{
margin-top
:
$baseline
;
}
...
...
lms/static/sass/shared-v2/_components.scss
View file @
25229a74
...
...
@@ -149,3 +149,7 @@
}
}
}
.section
:not
(
:first-child
)
{
margin-top
:
$baseline
;
}
openedx/features/course_experience/__init__.py
View file @
25229a74
# Unified course experience settings
# Unified course experience settings
.
# Waffle flag to enable a single unified "Course" tab.
UNIFIED_COURSE_EXPERIENCE_FLAG
=
'unified_course_experience'
# Waffle flag to enable the full screen course content view
# along with a unified course home page.
UNIFIED_COURSE_VIEW_FLAG
=
'unified_course_view'
openedx/features/course_experience/templates/course_experience/course-home-fragment.html
View file @
25229a74
...
...
@@ -65,7 +65,8 @@ from openedx.features.course_experience import UNIFIED_COURSE_EXPERIENCE_FLAG
${HTML(outline_fragment.body_html())}
</main>
<aside
class=
"layout-col layout-col-a"
>
<h3
class=
"hd-6"
>
Course Tools
</h3>
<div
class=
"section section-tools"
>
<h3
class=
"hd-6"
>
${_("Course Tools")}
</h3>
<ul
class=
"list-unstyled"
>
<li>
<a
class=
"action-show-bookmarks"
href=
"${reverse('openedx.course_bookmarks.home', args=[course.id])}"
>
...
...
@@ -74,6 +75,13 @@ from openedx.features.course_experience import UNIFIED_COURSE_EXPERIENCE_FLAG
</a>
</li>
</ul>
</div>
% if handouts_html:
<div
class=
"section section-handouts"
>
<h3
class=
"hd-6"
>
${_("Course Handouts")}
</h3>
${HTML(handouts_html)}
</div>
% endif
</aside>
</div>
% else:
...
...
openedx/features/course_experience/views/course_home.py
View file @
25229a74
...
...
@@ -9,7 +9,7 @@ from django.utils.decorators import method_decorator
from
django.views.decorators.cache
import
cache_control
from
django.views.decorators.csrf
import
ensure_csrf_cookie
from
courseware.courses
import
get_course_with_access
,
get_last_accessed_courseware
from
courseware.courses
import
get_course_
info_section
,
get_course_
with_access
,
get_last_accessed_courseware
from
lms.djangoapps.courseware.views.views
import
CourseTabView
from
opaque_keys.edx.keys
import
CourseKey
from
openedx.core.djangoapps.plugin_api.views
import
EdxFragmentView
...
...
@@ -56,11 +56,15 @@ class CourseHomeFragmentView(EdxFragmentView):
# Get the last accessed courseware
last_accessed_url
,
__
=
get_last_accessed_courseware
(
course
,
request
,
request
.
user
)
# Get the handouts
handouts_html
=
get_course_info_section
(
request
,
request
.
user
,
course
,
'handouts'
)
# Render the course home fragment
context
=
{
'csrf'
:
csrf
(
request
)[
'csrf_token'
],
'course'
:
course
,
'outline_fragment'
:
outline_fragment
,
'handouts_html'
:
handouts_html
,
'has_visited_course'
:
last_accessed_url
is
not
None
,
'disable_courseware_js'
:
True
,
'uses_pattern_library'
:
True
,
...
...
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