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
75a0fdf0
Commit
75a0fdf0
authored
May 02, 2017
by
Andy Armstrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable course sidebar for new course home page
LEARNER-764
parent
37eba6ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
44 deletions
+41
-44
lms/templates/courseware/info.html
+8
-0
openedx/features/course_experience/templates/course_experience/course-home-fragment.html
+32
-43
openedx/features/course_experience/tests/views/test_course_home.py
+1
-1
No files found.
lms/templates/courseware/info.html
View file @
75a0fdf0
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
from
datetime
import
datetime
from
datetime
import
datetime
from
pytz
import
timezone
,
utc
from
pytz
import
timezone
,
utc
from
django
.
core
.
urlresolvers
import
reverse
from
django
.
utils
.
translation
import
ugettext
as
_
from
django
.
utils
.
translation
import
ugettext
as
_
from
courseware
.
courses
import
get_course_info_section
,
get_course_date_blocks
from
courseware
.
courses
import
get_course_info_section
,
get_course_date_blocks
...
@@ -113,6 +114,13 @@ from openedx.core.djangolib.markup import HTML, Text
...
@@ -113,6 +114,13 @@ from openedx.core.djangolib.markup import HTML, Text
</section>
</section>
<section
aria-label=
"${_('Handout Navigation')}"
class=
"handouts"
>
<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:
% if SelfPacedConfiguration.current().enable_course_home_improvements:
${HTML(dates_fragment.body_html())}
${HTML(dates_fragment.body_html())}
...
...
openedx/features/course_experience/templates/course_experience/course-home-fragment.html
View file @
75a0fdf0
...
@@ -23,13 +23,9 @@ from openedx.features.course_experience import UNIFIED_COURSE_EXPERIENCE_FLAG
...
@@ -23,13 +23,9 @@ from openedx.features.course_experience import UNIFIED_COURSE_EXPERIENCE_FLAG
<header
class=
"page-header has-secondary"
>
<header
class=
"page-header has-secondary"
>
<div
class=
"page-header-main"
>
<div
class=
"page-header-main"
>
<nav
aria-label=
"${_('Course Outline')}"
class=
"sr-is-focusable"
tabindex=
"-1"
>
<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"
>
<h2
class=
"hd hd-3 page-title"
>
${_("{course_name}").format(org=course.display_org_with_default, course_name=course.display_name_with_default)}
${_("{course_name}").format(org=course.display_org_with_default, course_name=course.display_name_with_default)}
</h2>
</h2>
% else:
<h2
class=
"hd hd-2 page-title"
>
${_('Course Outline')}
</h2>
% endif
</nav>
</nav>
</div>
</div>
<div
class=
"page-header-secondary"
>
<div
class=
"page-header-secondary"
>
...
@@ -49,11 +45,6 @@ from openedx.features.course_experience import UNIFIED_COURSE_EXPERIENCE_FLAG
...
@@ -49,11 +45,6 @@ from openedx.features.course_experience import UNIFIED_COURSE_EXPERIENCE_FLAG
</div>
</div>
% endif
% endif
<div
class=
"form-actions"
>
<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:
% if resume_course_url:
<a
class=
"btn btn-brand action-resume-course"
href=
"${resume_course_url}"
>
<a
class=
"btn btn-brand action-resume-course"
href=
"${resume_course_url}"
>
% if has_visited_course:
% if has_visited_course:
...
@@ -67,43 +58,41 @@ from openedx.features.course_experience import UNIFIED_COURSE_EXPERIENCE_FLAG
...
@@ -67,43 +58,41 @@ from openedx.features.course_experience import UNIFIED_COURSE_EXPERIENCE_FLAG
</div>
</div>
</header>
</header>
<div
class=
"page-content"
>
<div
class=
"page-content"
>
% if waffle.flag_is_active(request, UNIFIED_COURSE_EXPERIENCE_FLAG):
<div
class=
"layout layout-1q3q"
>
<div
class=
"layout layout-1q3q"
>
<main
class=
"layout-col layout-col-b"
>
<main
class=
"layout-col layout-col-b"
>
${HTML(outline_fragment.body_html())}
${HTML(outline_fragment.body_html())}
</main>
</main>
<aside
class=
"course-sidebar layout-col layout-col-a"
>
<aside
class=
"course-sidebar layout-col layout-col-a"
>
<div
class=
"section section-tools"
>
<div
class=
"section section-tools"
>
<h3
class=
"hd-6"
>
${_("Course Tools")}
</h3>
<h3
class=
"hd-6"
>
${_("Course Tools")}
</h3>
<ul
class=
"list-unstyled"
>
<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>
<li>
<a
class=
"action-show-bookmarks"
href=
"${reverse('openedx.course_bookmarks.home', args=[course_key])}"
>
<a
href=
"${reverse('openedx.course_experience.course_updates', args=[course.id])}"
>
<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])}"
>
<span
class=
"icon fa fa-newspaper-o"
aria-hidden=
"true"
></span>
<span
class=
"icon fa fa-newspaper-o"
aria-hidden=
"true"
></span>
${_("Updates")}
${_("Updates")}
</a>
</a>
</li>
</li>
</ul>
% endif
</div>
</ul>
<div
class=
"section section-dates"
>
</div>
${HTML(dates_fragment.body_html())}
<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>
% if handouts_html:
% endif
<div
class=
"section section-handouts"
>
</aside>
<h3
class=
"hd-6"
>
${_("Course Handouts")}
</h3>
</div>
${HTML(handouts_html)}
</div>
% endif
</aside>
</div>
% else:
${HTML(outline_fragment.body_html())}
% endif
</div>
</div>
</div>
</div>
</
%
block>
</
%
block>
openedx/features/course_experience/tests/views/test_course_home.py
View file @
75a0fdf0
...
@@ -65,7 +65,7 @@ class TestCourseHomePage(SharedModuleStoreTestCase):
...
@@ -65,7 +65,7 @@ class TestCourseHomePage(SharedModuleStoreTestCase):
get_course_in_cache
(
self
.
course
.
id
)
get_course_in_cache
(
self
.
course
.
id
)
# Fetch the view and verify the query counts
# Fetch the view and verify the query counts
with
self
.
assertNumQueries
(
3
7
):
with
self
.
assertNumQueries
(
3
5
):
with
check_mongo_calls
(
3
):
with
check_mongo_calls
(
3
):
url
=
course_home_url
(
self
.
course
)
url
=
course_home_url
(
self
.
course
)
self
.
client
.
get
(
url
)
self
.
client
.
get
(
url
)
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