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
26e735b1
Commit
26e735b1
authored
Oct 12, 2012
by
Chris Dodge
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/cale/cms-master' of github.com:MITx/mitx into feature/cdodge/cas-new-course
parents
4e4b6acc
d10f56dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
cms/djangoapps/contentstore/views.py
+15
-2
cms/templates/import.html
+1
-1
No files found.
cms/djangoapps/contentstore/views.py
View file @
26e735b1
...
...
@@ -182,6 +182,12 @@ def edit_subsection(request, location):
item
=
modulestore
()
.
get_item
(
location
)
# TODO: we need a smarter way to figure out what course an item is in
for
course
in
modulestore
()
.
get_courses
():
if
(
course
.
location
.
org
==
item
.
location
.
org
and
course
.
location
.
course
==
item
.
location
.
course
):
break
lms_link
=
get_lms_link_for_item
(
location
)
# make sure that location references a 'sequential', otherwise return BadRequest
...
...
@@ -229,6 +235,12 @@ def edit_unit(request, location):
item
=
modulestore
()
.
get_item
(
location
)
# TODO: we need a smarter way to figure out what course an item is in
for
course
in
modulestore
()
.
get_courses
():
if
(
course
.
location
.
org
==
item
.
location
.
org
and
course
.
location
.
course
==
item
.
location
.
course
):
break
# The non-draft location
lms_link
=
get_lms_link_for_item
(
item
.
location
.
_replace
(
revision
=
None
))
...
...
@@ -265,7 +277,7 @@ def edit_unit(request, location):
published_date
=
None
return
render_to_response
(
'unit.html'
,
{
'context_course'
:
item
,
'context_course'
:
course
,
'active_tab'
:
'courseware'
,
'unit'
:
item
,
'unit_location'
:
location
,
...
...
@@ -909,7 +921,8 @@ def import_course(request, org, course, name):
course_dir
=
filename
.
replace
(
'.tar.gz'
,
''
)
tf
=
tarfile
.
open
(
temp_filepath
)
shutil
.
rmtree
(
data_root
/
course_dir
)
if
(
data_root
/
course_dir
)
.
isdir
():
shutil
.
rmtree
(
data_root
/
course_dir
)
tf
.
extractall
(
data_root
+
'/'
)
os
.
remove
(
temp_filepath
)
# remove the .tar.gz file
...
...
cms/templates/import.html
View file @
26e735b1
...
...
@@ -28,7 +28,7 @@
</
%
block>
<
%
block
name=
"jsextra"
>
<script
src=
"
http:
//malsup.github.com/jquery.form.js"
></script>
<script
src=
"//malsup.github.com/jquery.form.js"
></script>
<script>
(
function
()
{
...
...
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