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
d7cbd1c8
Commit
d7cbd1c8
authored
Sep 18, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't do extra json conversion/de-conversion for data/children going to the cms
parent
bb06a926
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
7 deletions
+4
-7
cms/djangoapps/contentstore/views.py
+2
-2
cms/static/coffee/src/models/module.coffee
+1
-4
cms/static/coffee/src/views/module_edit.coffee
+1
-1
No files found.
cms/djangoapps/contentstore/views.py
View file @
d7cbd1c8
...
...
@@ -277,11 +277,11 @@ def save_item(request):
raise
Http404
# TODO (vshnayder): better error
if
request
.
POST
[
'data'
]:
data
=
json
.
loads
(
request
.
POST
[
'data'
])
data
=
request
.
POST
[
'data'
]
modulestore
()
.
update_item
(
item_location
,
data
)
if
request
.
POST
[
'children'
]:
children
=
json
.
loads
(
request
.
POST
[
'children'
])
children
=
request
.
POST
[
'children'
]
modulestore
()
.
update_children
(
item_location
,
children
)
# Export the course back to github
...
...
cms/static/coffee/src/models/module.coffee
View file @
d7cbd1c8
...
...
@@ -11,9 +11,6 @@ class CMS.Models.Module extends Backbone.Model
editUrl
:
->
"/edit_item?
#{
$
.
param
(
id
:
@
get
(
'id'
))
}
"
updateChildren
:
(
children
)
->
@
set
(
children
:
JSON
.
stringify
(
children
))
save
:
(
args
...)
->
@
set
(
data
:
JSON
.
stringify
(
@
module
.
save
()
))
if
@
module
@
set
(
data
:
@
module
.
save
(
))
if
@
module
super
(
args
...)
cms/static/coffee/src/views/module_edit.coffee
View file @
d7cbd1c8
...
...
@@ -22,7 +22,7 @@ class CMS.Views.ModuleEdit extends Backbone.View
@
$children
.
sortable
(
placeholder
:
"ui-state-highlight"
update
:
(
event
,
ui
)
=>
@
model
.
updateChildren
(
@
$children
.
find
(
'.module-edit'
).
map
(
@
model
.
set
(
children
:
@
$children
.
find
(
'.module-edit'
).
map
(
(
idx
,
el
)
->
$
(
el
).
data
(
'id'
)
).
toArray
())
)
...
...
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