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
e7e7b3bc
Commit
e7e7b3bc
authored
Apr 24, 2017
by
Andy Armstrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a sidebar to the new course home page
LEARNER-606
parent
c9f9b728
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
7 deletions
+38
-7
lms/djangoapps/courseware/tabs.py
+2
-1
lms/djangoapps/courseware/views/index.py
+2
-1
lms/templates/courseware/courseware.html
+2
-1
openedx/features/course_experience/__init__.py
+4
-0
openedx/features/course_experience/templates/course_experience/course-home-fragment.html
+28
-4
No files found.
lms/djangoapps/courseware/tabs.py
View file @
e7e7b3bc
...
@@ -10,6 +10,7 @@ from django.utils.translation import ugettext as _, ugettext_noop
...
@@ -10,6 +10,7 @@ from django.utils.translation import ugettext as _, ugettext_noop
from
courseware.access
import
has_access
from
courseware.access
import
has_access
from
courseware.entrance_exams
import
user_can_skip_entrance_exam
from
courseware.entrance_exams
import
user_can_skip_entrance_exam
from
openedx.core.lib.course_tabs
import
CourseTabPluginManager
from
openedx.core.lib.course_tabs
import
CourseTabPluginManager
from
openedx.features.course_experience
import
UNIFIED_COURSE_VIEW_FLAG
from
request_cache.middleware
import
RequestCache
from
request_cache.middleware
import
RequestCache
from
student.models
import
CourseEnrollment
from
student.models
import
CourseEnrollment
from
xmodule.tabs
import
CourseTab
,
CourseTabList
,
key_checker
,
link_reverse_func
from
xmodule.tabs
import
CourseTab
,
CourseTabList
,
key_checker
,
link_reverse_func
...
@@ -43,7 +44,7 @@ class CoursewareTab(EnrolledTab):
...
@@ -43,7 +44,7 @@ class CoursewareTab(EnrolledTab):
"""
"""
Returns the main course URL for the current user.
Returns the main course URL for the current user.
"""
"""
if
waffle
.
flag_is_active
(
request
,
'unified_course_view'
):
if
waffle
.
flag_is_active
(
request
,
UNIFIED_COURSE_VIEW_FLAG
):
return
'edx.course_experience.course_home'
return
'edx.course_experience.course_home'
else
:
else
:
return
'courseware'
return
'courseware'
...
...
lms/djangoapps/courseware/views/index.py
View file @
e7e7b3bc
...
@@ -33,6 +33,7 @@ from openedx.core.djangoapps.user_api.preferences.api import get_user_preference
...
@@ -33,6 +33,7 @@ from openedx.core.djangoapps.user_api.preferences.api import get_user_preference
from
openedx.core.djangoapps.crawlers.models
import
CrawlersConfig
from
openedx.core.djangoapps.crawlers.models
import
CrawlersConfig
from
openedx.core.djangoapps.monitoring_utils
import
set_custom_metrics_for_course_key
from
openedx.core.djangoapps.monitoring_utils
import
set_custom_metrics_for_course_key
from
openedx.features.enterprise_support.api
import
data_sharing_consent_required
from
openedx.features.enterprise_support.api
import
data_sharing_consent_required
from
openedx.features.course_experience
import
UNIFIED_COURSE_VIEW_FLAG
from
request_cache.middleware
import
RequestCache
from
request_cache.middleware
import
RequestCache
from
shoppingcart.models
import
CourseRegistrationCode
from
shoppingcart.models
import
CourseRegistrationCode
from
student.views
import
is_course_blocked
from
student.views
import
is_course_blocked
...
@@ -338,7 +339,7 @@ class CoursewareIndex(View):
...
@@ -338,7 +339,7 @@ class CoursewareIndex(View):
'disable_optimizely'
:
True
,
'disable_optimizely'
:
True
,
'section_title'
:
None
,
'section_title'
:
None
,
'sequence_title'
:
None
,
'sequence_title'
:
None
,
'disable_accordion'
:
waffle
.
flag_is_active
(
request
,
'unified_course_view'
)
'disable_accordion'
:
waffle
.
flag_is_active
(
request
,
UNIFIED_COURSE_VIEW_FLAG
),
}
}
table_of_contents
=
toc_for_course
(
table_of_contents
=
toc_for_course
(
self
.
effective_user
,
self
.
effective_user
,
...
...
lms/templates/courseware/courseware.html
View file @
e7e7b3bc
...
@@ -12,6 +12,7 @@ from django.utils.translation import ugettext as _
...
@@ -12,6 +12,7 @@ from django.utils.translation import ugettext as _
from
edxnotes
.
helpers
import
is_feature_enabled
as
is_edxnotes_enabled
from
edxnotes
.
helpers
import
is_feature_enabled
as
is_edxnotes_enabled
from
openedx
.
core
.
djangolib
.
js_utils
import
js_escaped_string
from
openedx
.
core
.
djangolib
.
js_utils
import
js_escaped_string
from
openedx
.
core
.
djangolib
.
markup
import
HTML
from
openedx
.
core
.
djangolib
.
markup
import
HTML
from
openedx
.
features
.
course_experience
import
UNIFIED_COURSE_VIEW_FLAG
%
>
%
>
<
%
<
%
include_special_exams =
settings.FEATURES.get('ENABLE_SPECIAL_EXAMS',
False
)
and
(
course
.
enable_proctored_exams
or
course
.
enable_timed_exams
)
include_special_exams =
settings.FEATURES.get('ENABLE_SPECIAL_EXAMS',
False
)
and
(
course
.
enable_proctored_exams
or
course
.
enable_timed_exams
)
...
@@ -157,7 +158,7 @@ ${HTML(fragment.foot_html())}
...
@@ -157,7 +158,7 @@ ${HTML(fragment.foot_html())}
<main
id=
"main"
tabindex=
"-1"
aria-label=
"Content"
>
<main
id=
"main"
tabindex=
"-1"
aria-label=
"Content"
>
<div
<div
class=
"path"
class=
"path"
data-unified-course-view=
"${'true' if waffle.flag_is_active(request,
'unified_course_view'
) else 'false'}"
data-unified-course-view=
"${'true' if waffle.flag_is_active(request,
UNIFIED_COURSE_VIEW_FLAG
) else 'false'}"
></div>
></div>
% if getattr(course, 'entrance_exam_enabled') and \
% if getattr(course, 'entrance_exam_enabled') and \
getattr(course, 'entrance_exam_minimum_score_pct') and \
getattr(course, 'entrance_exam_minimum_score_pct') and \
...
...
openedx/features/course_experience/__init__.py
View file @
e7e7b3bc
# Unified course experience settings
UNIFIED_COURSE_EXPERIENCE_FLAG
=
'unified_course_experience'
UNIFIED_COURSE_VIEW_FLAG
=
'unified_course_view'
openedx/features/course_experience/templates/course_experience/course-home-fragment.html
View file @
e7e7b3bc
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
<
%!
<
%!
import
json
import
json
import
waffle
from
django
.
conf
import
settings
from
django
.
conf
import
settings
from
django
.
utils
.
translation
import
ugettext
as
_
from
django
.
utils
.
translation
import
ugettext
as
_
from
django
.
template
.
defaultfilters
import
escapejs
from
django
.
template
.
defaultfilters
import
escapejs
...
@@ -13,6 +15,7 @@ from django.core.urlresolvers import reverse
...
@@ -13,6 +15,7 @@ from django.core.urlresolvers import reverse
from
django_comment_client
.
permissions
import
has_permission
from
django_comment_client
.
permissions
import
has_permission
from
openedx
.
core
.
djangolib
.
js_utils
import
dump_js_escaped_json
,
js_escaped_string
from
openedx
.
core
.
djangolib
.
js_utils
import
dump_js_escaped_json
,
js_escaped_string
from
openedx
.
core
.
djangolib
.
markup
import
HTML
from
openedx
.
core
.
djangolib
.
markup
import
HTML
from
openedx
.
features
.
course_experience
import
UNIFIED_COURSE_EXPERIENCE_FLAG
%
>
%
>
<
%
block
name=
"content"
>
<
%
block
name=
"content"
>
...
@@ -25,9 +28,11 @@ from openedx.core.djangolib.markup import HTML
...
@@ -25,9 +28,11 @@ from openedx.core.djangolib.markup import HTML
</div>
</div>
<div
class=
"page-header-secondary"
>
<div
class=
"page-header-secondary"
>
<div
class=
"form-actions"
>
<div
class=
"form-actions"
>
<a
class=
"btn action-show-bookmarks"
href=
"${reverse('openedx.course_bookmarks.home', args=[course.id])}"
>
% if not waffle.flag_is_active(request, UNIFIED_COURSE_EXPERIENCE_FLAG):
${_("Bookmarks")}
<a
class=
"btn action-show-bookmarks"
href=
"${reverse('openedx.course_bookmarks.home', args=[course.id])}"
>
</a>
${_("Bookmarks")}
</a>
% endif
<a
class=
"btn btn-brand action-resume-course"
href=
"${reverse('courseware', kwargs={'course_id': unicode(course.id.to_deprecated_string())})}"
>
<a
class=
"btn btn-brand action-resume-course"
href=
"${reverse('courseware', kwargs={'course_id': unicode(course.id.to_deprecated_string())})}"
>
% if has_visited_course:
% if has_visited_course:
${_("Resume Course")}
${_("Resume Course")}
...
@@ -54,7 +59,26 @@ from openedx.core.djangolib.markup import HTML
...
@@ -54,7 +59,26 @@ from openedx.core.djangolib.markup import HTML
</div>
</div>
</header>
</header>
<div
class=
"page-content"
>
<div
class=
"page-content"
>
${HTML(outline_fragment.body_html())}
% 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=
"layout-col layout-col-a"
>
<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])}"
>
<span
class=
"icon fa fa-bookmark"
aria-hidden=
"true"
></span>
${_("Bookmarks")}
</a>
</li>
</ul>
</aside>
</div>
% else:
${HTML(outline_fragment.body_html())}
% endif
</div>
</div>
</div>
</div>
</
%
block>
</
%
block>
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