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
be4045cb
Commit
be4045cb
authored
Mar 21, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce pep8 warnings, move Checklistst to top of menu.
parent
8385db85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
26 deletions
+28
-26
cms/djangoapps/contentstore/views.py
+27
-25
cms/templates/widgets/header.html
+1
-1
No files found.
cms/djangoapps/contentstore/views.py
View file @
be4045cb
...
...
@@ -51,7 +51,8 @@ from xmodule.contentstore.content import StaticContent
from
auth.authz
import
is_user_in_course_group_role
,
get_users_in_course_group_by_role
from
auth.authz
import
get_user_by_email
,
add_user_to_course_group
,
remove_user_from_course_group
from
auth.authz
import
INSTRUCTOR_ROLE_NAME
,
STAFF_ROLE_NAME
,
create_all_course_groups
from
.utils
import
get_course_location_for_item
,
get_lms_link_for_item
,
compute_unit_state
,
get_date_display
,
UnitState
,
get_course_for_item
,
get_url_reverse
from
.utils
import
get_course_location_for_item
,
get_lms_link_for_item
,
compute_unit_state
,
\
get_date_display
,
UnitState
,
get_course_for_item
,
get_url_reverse
from
xmodule.modulestore.xml_importer
import
import_from_xml
from
contentstore.course_info_model
import
get_course_updates
,
\
...
...
@@ -182,10 +183,10 @@ def course_index(request, org, course, name):
lms_link
=
get_lms_link_for_item
(
location
)
upload_asset_callback_url
=
reverse
(
'upload_asset'
,
kwargs
=
{
'org'
:
org
,
'course'
:
course
,
'coursename'
:
name
})
'org'
:
org
,
'course'
:
course
,
'coursename'
:
name
})
course
=
modulestore
()
.
get_item
(
location
)
sections
=
course
.
get_children
()
...
...
@@ -241,7 +242,7 @@ def edit_subsection(request, location):
for
field
in
item
.
fields
if
field
.
name
not
in
[
'display_name'
,
'start'
,
'due'
,
'format'
]
and
field
.
scope
==
Scope
.
settings
field
.
scope
==
Scope
.
settings
)
can_view_live
=
False
...
...
@@ -253,18 +254,18 @@ def edit_subsection(request, location):
break
return
render_to_response
(
'edit_subsection.html'
,
{
'subsection'
:
item
,
'context_course'
:
course
,
'create_new_unit_template'
:
Location
(
'i4x'
,
'edx'
,
'templates'
,
'vertical'
,
'Empty'
),
'lms_link'
:
lms_link
,
'preview_link'
:
preview_link
,
'course_graders'
:
json
.
dumps
(
CourseGradingModel
.
fetch
(
course
.
location
)
.
graders
),
'parent_location'
:
course
.
location
,
'parent_item'
:
parent
,
'policy_metadata'
:
policy_metadata
,
'subsection_units'
:
subsection_units
,
'can_view_live'
:
can_view_live
})
{
'subsection'
:
item
,
'context_course'
:
course
,
'create_new_unit_template'
:
Location
(
'i4x'
,
'edx'
,
'templates'
,
'vertical'
,
'Empty'
),
'lms_link'
:
lms_link
,
'preview_link'
:
preview_link
,
'course_graders'
:
json
.
dumps
(
CourseGradingModel
.
fetch
(
course
.
location
)
.
graders
),
'parent_location'
:
course
.
location
,
'parent_item'
:
parent
,
'policy_metadata'
:
policy_metadata
,
'subsection_units'
:
subsection_units
,
'can_view_live'
:
can_view_live
})
@login_required
...
...
@@ -1294,7 +1295,7 @@ def get_checklists(request, org, course, name):
modulestore
=
get_modulestore
(
location
)
course_module
=
modulestore
.
get_item
(
location
)
new_course_template
=
Location
(
'i4x'
,
'edx'
,
'templates'
,
'course'
,
'Empty'
)
new_course_template
=
Location
(
'i4x'
,
'edx'
,
'templates'
,
'course'
,
'Empty'
)
template_module
=
modulestore
.
get_item
(
new_course_template
)
# If course was created before checklists were introduced, copy them over from the template.
...
...
@@ -1309,7 +1310,7 @@ def get_checklists(request, org, course, name):
return
render_to_response
(
'checklists.html'
,
{
'context_course'
:
course_module
,
'checklists'
:
checklists
'checklists'
:
checklists
})
...
...
@@ -1338,7 +1339,8 @@ def update_checklist(request, org, course, name, checklist_index=None):
modulestore
.
update_metadata
(
location
,
own_metadata
(
course_module
))
return
HttpResponse
(
json
.
dumps
(
checklists
[
index
]),
mimetype
=
"application/json"
)
else
:
return
HttpResponseBadRequest
(
"Could not save checklist state because the checklist index was out of range or unspecified."
,
return
HttpResponseBadRequest
(
"Could not save checklist state because the checklist index was out of range or unspecified."
,
content_type
=
"text/plain"
)
elif
request
.
method
==
'GET'
:
# In the JavaScript view initialize method, we do a fetch to get all the checklists.
...
...
@@ -1381,10 +1383,10 @@ def asset_index(request, org, course, name):
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
upload_asset_callback_url
=
reverse
(
'upload_asset'
,
kwargs
=
{
'org'
:
org
,
'course'
:
course
,
'coursename'
:
name
})
'org'
:
org
,
'course'
:
course
,
'coursename'
:
name
})
course_module
=
modulestore
()
.
get_item
(
location
)
...
...
cms/templates/widgets/header.html
View file @
be4045cb
...
...
@@ -56,9 +56,9 @@
<div
class=
"wrapper wrapper-nav-sub"
>
<div
class=
"nav-sub"
>
<ul>
<li
class=
"nav-item nav-course-tools-checklists"
><a
href=
"${reverse('checklists', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Checklists
</a></li>
<li
class=
"nav-item nav-course-tools-import"
><a
href=
"${reverse('import_course', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Import
</a></li>
<li
class=
"nav-item nav-course-tools-export"
><a
href=
"${reverse('export_course', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Export
</a></li>
<li
class=
"nav-item nav-course-tools-checklists"
><a
href=
"${reverse('checklists', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Checklists
</a></li>
</ul>
</div>
</div>
...
...
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