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
b38750e1
Commit
b38750e1
authored
Aug 05, 2013
by
Julian Arni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor wrap_xmodule call
parent
7bfb0804
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
cms/djangoapps/contentstore/views/preview.py
+6
-4
No files found.
cms/djangoapps/contentstore/views/preview.py
View file @
b38750e1
...
...
@@ -75,13 +75,15 @@ def preview_component(request, location):
component
=
modulestore
()
.
get_item
(
location
)
# wrap_xmodule expects a function, so make a constant function
def
get_render
():
return
component
.
runtime
.
render
(
component
,
None
,
"studio_view"
)
.
content
component
.
get_html
=
wrap_xmodule
(
component
.
get_html
,
component
,
'xmodule_edit.html'
)
return
render_to_response
(
'component.html'
,
{
'preview'
:
get_module_previews
(
request
,
component
)[
0
],
'editor'
:
wrap_xmodule
(
get_render
,
component
,
'xmodule_edit.html'
)()
,
'editor'
:
component
.
runtime
.
render
(
component
,
None
,
'studio_view'
)
.
content
,
})
...
...
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