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
96d030b6
Commit
96d030b6
authored
Nov 10, 2015
by
Ahsan Ulhaq
Committed by
Peter Fogg
Feb 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverse and Rename Courseware and Course Info Tabs
ECOM-2678
parent
fd397964
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
63 additions
and
46 deletions
+63
-46
cms/djangoapps/contentstore/features/pages.py
+4
-4
cms/djangoapps/contentstore/tests/test_course_settings.py
+2
-2
common/lib/xmodule/xmodule/course_module.py
+2
-2
common/lib/xmodule/xmodule/tabs.py
+20
-6
common/test/acceptance/pages/lms/tab_nav.py
+1
-1
common/test/acceptance/tests/lms/test_certificate_web_view.py
+1
-1
common/test/acceptance/tests/lms/test_lms.py
+11
-11
common/test/acceptance/tests/lms/test_lms_acid_xblock.py
+3
-3
common/test/acceptance/tests/video/test_video_module.py
+1
-1
lms/djangoapps/course_wiki/tests/tests.py
+2
-2
lms/djangoapps/courseware/features/navigation.feature
+1
-1
lms/djangoapps/courseware/features/navigation.py
+5
-3
lms/djangoapps/courseware/tabs.py
+2
-2
lms/djangoapps/courseware/tests/test_about.py
+2
-2
lms/djangoapps/courseware/tests/test_tabs.py
+3
-2
lms/djangoapps/lms_xblock/mixin.py
+2
-2
lms/templates/courseware/course_about.html
+1
-1
No files found.
cms/djangoapps/contentstore/features/pages.py
View file @
96d030b6
...
...
@@ -98,25 +98,25 @@ def _verify_page_names(first, second):
@step
(
u'the built-in pages are in the default order$'
)
def
built_in_pages_in_default_order
(
step
):
expected_pages
=
[
'
Courseware'
,
'Course Info
'
,
'Wiki'
,
'Progress'
]
expected_pages
=
[
'
Home'
,
'Course
'
,
'Wiki'
,
'Progress'
]
see_pages_in_expected_order
(
expected_pages
)
@step
(
u'the built-in pages are switched$'
)
def
built_in_pages_switched
(
step
):
expected_pages
=
[
'
Courseware'
,
'Course Info
'
,
'Progress'
,
'Wiki'
]
expected_pages
=
[
'
Home'
,
'Course
'
,
'Progress'
,
'Wiki'
]
see_pages_in_expected_order
(
expected_pages
)
@step
(
u'the pages are in the default order$'
)
def
pages_in_default_order
(
step
):
expected_pages
=
[
'
Courseware'
,
'Course Info
'
,
'Wiki'
,
'Progress'
,
'First'
,
'Empty'
]
expected_pages
=
[
'
Home'
,
'Course
'
,
'Wiki'
,
'Progress'
,
'First'
,
'Empty'
]
see_pages_in_expected_order
(
expected_pages
)
@step
(
u'the pages are switched$$'
)
def
pages_are_switched
(
step
):
expected_pages
=
[
'
Courseware'
,
'Course Info
'
,
'Progress'
,
'First'
,
'Empty'
,
'Wiki'
]
expected_pages
=
[
'
Home'
,
'Course
'
,
'Progress'
,
'First'
,
'Empty'
,
'Wiki'
]
see_pages_in_expected_order
(
expected_pages
)
...
...
cms/djangoapps/contentstore/tests/test_course_settings.py
View file @
96d030b6
...
...
@@ -936,8 +936,8 @@ class CourseMetadataEditingTest(CourseTestCase):
self
.
assertNotIn
(
"notes"
,
course
.
advanced_modules
)
@ddt.data
(
[{
'type'
:
'course
ware'
},
{
'type'
:
'course_info
'
},
{
'type'
:
'wiki'
,
'is_hidden'
:
True
}],
[{
'type'
:
'course
ware'
,
'name'
:
'Courses'
},
{
'type'
:
'course_info'
,
'name'
:
'Info
'
}],
[{
'type'
:
'course
_info'
},
{
'type'
:
'courseware
'
},
{
'type'
:
'wiki'
,
'is_hidden'
:
True
}],
[{
'type'
:
'course
_info'
,
'name'
:
'Home'
},
{
'type'
:
'courseware'
,
'name'
:
'Course
'
}],
)
def
test_course_tab_configurations
(
self
,
tab_list
):
self
.
course
.
tabs
=
tab_list
...
...
common/lib/xmodule/xmodule/course_module.py
View file @
96d030b6
...
...
@@ -424,9 +424,9 @@ class CourseFields(object):
)
has_children
=
True
info_sidebar_name
=
String
(
display_name
=
_
(
"Course
Info
Sidebar Name"
),
display_name
=
_
(
"Course
Home
Sidebar Name"
),
help
=
_
(
"Enter the heading that you want students to see above your course handouts on the Course
Info
page. "
"Enter the heading that you want students to see above your course handouts on the Course
Home
page. "
"Your course handouts appear in the right panel of the page."
),
scope
=
Scope
.
settings
,
default
=
'Course Handouts'
)
...
...
common/lib/xmodule/xmodule/tabs.py
View file @
96d030b6
...
...
@@ -305,8 +305,8 @@ class CourseTabList(List):
"""
course
.
tabs
.
extend
([
CourseTab
.
load
(
'course
ware
'
),
CourseTab
.
load
(
'course
_info
'
)
CourseTab
.
load
(
'course
_info
'
),
CourseTab
.
load
(
'course
ware
'
)
])
# Presence of syllabus tab is indicated by a course attribute
...
...
@@ -390,6 +390,19 @@ class CourseTabList(List):
yield
tab
@classmethod
def
upgrade_tabs
(
cls
,
tabs
):
"""
Reverse and Rename Courseware to Course and Course Info to Home Tabs.
"""
if
tabs
and
len
(
tabs
)
>
1
:
if
tabs
[
0
]
.
get
(
'type'
)
==
'courseware'
and
tabs
[
1
]
.
get
(
'type'
)
==
'course_info'
:
tabs
[
0
],
tabs
[
1
]
=
tabs
[
1
],
tabs
[
0
]
tabs
[
0
][
'name'
]
=
_
(
'Home'
)
tabs
[
1
][
'name'
]
=
_
(
'Course'
)
return
tabs
@classmethod
def
validate_tabs
(
cls
,
tabs
):
"""
Check that the tabs set for the specified course is valid. If it
...
...
@@ -406,13 +419,13 @@ class CourseTabList(List):
if
len
(
tabs
)
<
2
:
raise
InvalidTabsException
(
"Expected at least two tabs. tabs: '{0}'"
.
format
(
tabs
))
if
tabs
[
0
]
.
get
(
'type'
)
!=
'course
ware
'
:
if
tabs
[
0
]
.
get
(
'type'
)
!=
'course
_info
'
:
raise
InvalidTabsException
(
"Expected first tab to have type 'course
ware
'. tabs: '{0}'"
.
format
(
tabs
))
"Expected first tab to have type 'course
_info
'. tabs: '{0}'"
.
format
(
tabs
))
if
tabs
[
1
]
.
get
(
'type'
)
!=
'course
_info
'
:
if
tabs
[
1
]
.
get
(
'type'
)
!=
'course
ware
'
:
raise
InvalidTabsException
(
"Expected second tab to have type 'course
_info
'. tabs: '{0}'"
.
format
(
tabs
))
"Expected second tab to have type 'course
ware
'. tabs: '{0}'"
.
format
(
tabs
))
# the following tabs should appear only once
# TODO: don't import openedx capabilities from common
...
...
@@ -455,6 +468,7 @@ class CourseTabList(List):
"""
Overrides the from_json method to de-serialize the CourseTab objects from a json-like representation.
"""
self
.
upgrade_tabs
(
values
)
self
.
validate_tabs
(
values
)
tabs
=
[]
for
tab_dict
in
values
:
...
...
common/test/acceptance/pages/lms/tab_nav.py
View file @
96d030b6
...
...
@@ -21,7 +21,7 @@ class TabNavPage(PageObject):
Navigate to the tab `tab_name`.
"""
if
tab_name
not
in
[
'Course
ware'
,
'Course Info
'
,
'Discussion'
,
'Wiki'
,
'Progress'
]:
if
tab_name
not
in
[
'Course
'
,
'Home
'
,
'Discussion'
,
'Wiki'
,
'Progress'
]:
self
.
warning
(
"'{0}' is not a valid tab name"
.
format
(
tab_name
))
# The only identifier for individual tabs is the link href
...
...
common/test/acceptance/tests/lms/test_certificate_web_view.py
View file @
96d030b6
...
...
@@ -206,7 +206,7 @@ class CertificateProgressPageTest(UniqueCourseTest):
Problems were added in the setUp
"""
self
.
course_info_page
.
visit
()
self
.
tab_nav
.
go_to_tab
(
'Course
ware
'
)
self
.
tab_nav
.
go_to_tab
(
'Course'
)
# Navigate to Test Subsection in Test Section Section
self
.
course_nav
.
go_to_section
(
'Test Section'
,
'Test Subsection'
)
...
...
common/test/acceptance/tests/lms/test_lms.py
View file @
96d030b6
...
...
@@ -597,7 +597,7 @@ class HighLevelTabTest(UniqueCourseTest):
# Navigate to the course info page from the progress page
self
.
progress_page
.
visit
()
self
.
tab_nav
.
go_to_tab
(
'
Course Info
'
)
self
.
tab_nav
.
go_to_tab
(
'
Home
'
)
# Expect just one update
self
.
assertEqual
(
self
.
course_info_page
.
num_updates
,
1
)
...
...
@@ -667,13 +667,13 @@ class HighLevelTabTest(UniqueCourseTest):
def
test_courseware_nav
(
self
):
"""
Navigate to a particular unit in the course
ware
.
Navigate to a particular unit in the course.
"""
# Navigate to the course
ware
page from the info page
# Navigate to the course page from the info page
self
.
course_info_page
.
visit
()
self
.
tab_nav
.
go_to_tab
(
'Course
ware
'
)
self
.
tab_nav
.
go_to_tab
(
'Course'
)
# Check that the course
ware
navigation appears correctly
# Check that the course navigation appears correctly
EXPECTED_SECTIONS
=
{
'Test Section'
:
[
'Test Subsection'
],
'Test Section 2'
:
[
'Test Subsection 2'
,
'Test Subsection 3'
]
...
...
@@ -862,7 +862,7 @@ class TooltipTest(UniqueCourseTest):
Verify that tooltips are displayed when you hover over the sequence nav bar.
"""
self
.
course_info_page
.
visit
()
self
.
tab_nav
.
go_to_tab
(
'Course
ware
'
)
self
.
tab_nav
.
go_to_tab
(
'Course'
)
self
.
courseware_page
.
verify_tooltips_displayed
()
...
...
@@ -1011,7 +1011,7 @@ class ProblemExecutionTest(UniqueCourseTest):
def
test_python_execution_in_problem
(
self
):
# Navigate to the problem page
self
.
course_info_page
.
visit
()
self
.
tab_nav
.
go_to_tab
(
'Course
ware
'
)
self
.
tab_nav
.
go_to_tab
(
'Course'
)
self
.
course_nav
.
go_to_section
(
'Test Section'
,
'Test Subsection'
)
problem_page
=
ProblemPage
(
self
.
browser
)
...
...
@@ -1061,14 +1061,14 @@ class EntranceExamTest(UniqueCourseTest):
def
test_entrance_exam_section
(
self
):
"""
Scenario: Any course that is enabled for an entrance exam, should have entrance exam chapter at course
ware
Scenario: Any course that is enabled for an entrance exam, should have entrance exam chapter at course
page.
Given that I am on the course
ware
page
When I view the course
ware
that has an entrance exam
Given that I am on the course page
When I view the course that has an entrance exam
Then there should be an "Entrance Exam" chapter.'
"""
entrance_exam_link_selector
=
'.accordion .course-navigation .chapter .group-heading'
# visit course
ware
page and make sure there is not entrance exam chapter.
# visit course page and make sure there is not entrance exam chapter.
self
.
courseware_page
.
visit
()
self
.
courseware_page
.
wait_for_page
()
self
.
assertFalse
(
element_has_text
(
...
...
common/test/acceptance/tests/lms/test_lms_acid_xblock.py
View file @
96d030b6
...
...
@@ -75,7 +75,7 @@ class XBlockAcidNoChildTest(XBlockAcidBase):
"""
self
.
course_info_page
.
visit
()
self
.
tab_nav
.
go_to_tab
(
'Course
ware
'
)
self
.
tab_nav
.
go_to_tab
(
'Course'
)
acid_block
=
AcidView
(
self
.
browser
,
'.xblock-student_view[data-block-type=acid]'
)
self
.
validate_acid_block_view
(
acid_block
)
...
...
@@ -119,7 +119,7 @@ class XBlockAcidChildTest(XBlockAcidBase):
"""
self
.
course_info_page
.
visit
()
self
.
tab_nav
.
go_to_tab
(
'Course
ware
'
)
self
.
tab_nav
.
go_to_tab
(
'Course'
)
acid_parent_block
=
AcidView
(
self
.
browser
,
'.xblock-student_view[data-block-type=acid_parent]'
)
self
.
validate_acid_parent_block_view
(
acid_parent_block
)
...
...
@@ -159,7 +159,7 @@ class XBlockAcidAsideTest(XBlockAcidBase):
"""
self
.
course_info_page
.
visit
()
self
.
tab_nav
.
go_to_tab
(
'Course
ware
'
)
self
.
tab_nav
.
go_to_tab
(
'Course'
)
acid_aside
=
AcidView
(
self
.
browser
,
'.xblock_asides-v1-student_view[data-block-type=acid_aside]'
)
self
.
validate_acid_aside_view
(
acid_aside
)
...
...
common/test/acceptance/tests/video/test_video_module.py
View file @
96d030b6
...
...
@@ -132,7 +132,7 @@ class VideoBaseTest(UniqueCourseTest):
self
.
auth_page
.
visit
()
self
.
user_info
=
self
.
auth_page
.
user_info
self
.
course_info_page
.
visit
()
self
.
tab_nav
.
go_to_tab
(
'Course
ware
'
)
self
.
tab_nav
.
go_to_tab
(
'Course'
)
def
_navigate_to_courseware_video_and_render
(
self
):
""" Wait for the video player to render """
...
...
lms/djangoapps/course_wiki/tests/tests.py
View file @
96d030b6
...
...
@@ -103,8 +103,8 @@ class WikiRedirectTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
"""
Ensure that the response has the course navigator.
"""
self
.
assertContains
(
resp
,
"
Course Info
"
)
self
.
assertContains
(
resp
,
"
coursewar
e"
)
self
.
assertContains
(
resp
,
"
Home
"
)
self
.
assertContains
(
resp
,
"
Cours
e"
)
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'ALLOW_WIKI_ROOT_ACCESS'
:
True
})
def
test_course_navigator
(
self
):
...
...
lms/djangoapps/courseware/features/navigation.feature
View file @
96d030b6
...
...
@@ -24,5 +24,5 @@ Feature: LMS.Navigate Course
Given
I am viewing a course with multiple sections
When
I navigate to a section
And
I see the content of the section
And
I return to the course
ware
And
I return to the course
Then
I see that I was most recently in the subsection
lms/djangoapps/courseware/features/navigation.py
View file @
96d030b6
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from
lettuce
import
world
,
step
from
common
import
course_location
...
...
@@ -127,11 +128,12 @@ def then_i_see_the_content_of_the_sequence_item(step):
wait_for_problem
(
'Problem 6'
)
@step
(
u'I return to the course
ware
'
)
def
and_i_return_to_the_course
ware
(
step
):
@step
(
u'I return to the course'
)
def
and_i_return_to_the_course
(
step
):
world
.
visit
(
'/'
)
world
.
click_link
(
"View Course"
)
world
.
click_link
(
"Courseware"
)
course
=
'a[href*="/courseware"]'
world
.
css_click
(
course
)
@step
(
u'I see that I was most recently in the subsection'
)
...
...
lms/djangoapps/courseware/tabs.py
View file @
96d030b6
...
...
@@ -28,7 +28,7 @@ class CoursewareTab(EnrolledTab):
The main courseware view.
"""
type
=
'courseware'
title
=
ugettext_noop
(
'Course
ware
'
)
title
=
ugettext_noop
(
'Course'
)
priority
=
10
view_name
=
'courseware'
is_movable
=
False
...
...
@@ -40,7 +40,7 @@ class CourseInfoTab(CourseTab):
The course info view.
"""
type
=
'course_info'
title
=
ugettext_noop
(
'
Course Info
'
)
title
=
ugettext_noop
(
'
Home
'
)
priority
=
20
view_name
=
'info'
tab_id
=
'info'
...
...
lms/djangoapps/courseware/tests/test_about.py
View file @
96d030b6
...
...
@@ -105,7 +105,7 @@ class AboutTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase, EventTrackingT
resp
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertIn
(
"You are enrolled in this course"
,
resp
.
content
)
self
.
assertIn
(
"View Course
ware
"
,
resp
.
content
)
self
.
assertIn
(
"View Course"
,
resp
.
content
)
@override_settings
(
COURSE_ABOUT_VISIBILITY_PERMISSION
=
"see_about_page"
)
def
test_visible_about_page_settings
(
self
):
...
...
@@ -478,7 +478,7 @@ class AboutPurchaseCourseTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
resp
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertIn
(
"You are enrolled in this course"
,
resp
.
content
)
self
.
assertIn
(
"View Course
ware
"
,
resp
.
content
)
self
.
assertIn
(
"View Course"
,
resp
.
content
)
self
.
assertNotIn
(
"Add buyme to Cart <span>($10 USD)</span>"
,
resp
.
content
)
def
test_closed_enrollment
(
self
):
...
...
lms/djangoapps/courseware/tests/test_tabs.py
View file @
96d030b6
...
...
@@ -483,9 +483,10 @@ class TabListTestCase(TabTestCase):
[{
'type'
:
CoursewareTab
.
type
}],
# missing course_info
[{
'type'
:
CoursewareTab
.
type
},
{
'type'
:
'discussion'
,
'name'
:
'fake_name'
}],
[{
'type'
:
'unknown_type'
}],
# incorrect order
[{
'type'
:
CourseInfoTab
.
type
,
'name'
:
'fake_name'
},
{
'type'
:
CoursewareTab
.
type
}]
,
[{
'type'
:
'unknown_type'
}]
[{
'type'
:
'discussion'
,
'name'
:
'fake_name'
}
,
{
'type'
:
CourseInfoTab
.
type
,
'name'
:
'fake_name'
},
{
'type'
:
CoursewareTab
.
type
}],
]
# tab types that should appear only once
...
...
lms/djangoapps/lms_xblock/mixin.py
View file @
96d030b6
...
...
@@ -42,7 +42,7 @@ class LmsBlockMixin(XBlockMixin):
scope
=
Scope
.
settings
,
)
chrome
=
String
(
display_name
=
_
(
"Course
ware
Chrome"
),
display_name
=
_
(
"Course Chrome"
),
# Translators: DO NOT translate the words in quotes here, they are
# specific words for the acceptable values.
help
=
_
(
"Enter the chrome, or navigation tools, to use for the XBlock in the LMS. Valid values are:
\n
"
...
...
@@ -55,7 +55,7 @@ class LmsBlockMixin(XBlockMixin):
)
default_tab
=
String
(
display_name
=
_
(
"Default Tab"
),
help
=
_
(
"Enter the tab that is selected in the XBlock. If not set, the Course
ware
tab is selected."
),
help
=
_
(
"Enter the tab that is selected in the XBlock. If not set, the Course tab is selected."
),
scope
=
Scope
.
settings
,
default
=
None
,
)
...
...
lms/templates/courseware/course_about.html
View file @
96d030b6
...
...
@@ -126,7 +126,7 @@ from openedx.core.lib.courses import course_image_url
<span
class=
"register disabled"
>
${_("You are enrolled in this course")}
</span>
%if show_courseware_link:
<strong>
${_("View Course
ware
")}
</strong>
<strong>
${_("View Course")}
</strong>
</a>
%endif
...
...
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