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
8fbaa66d
Commit
8fbaa66d
authored
Apr 29, 2015
by
David Baumgold
Committed by
Sarina Canelake
May 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make courseware licenses show up in Studio XBlock previews
parent
648e8a20
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
cms/djangoapps/contentstore/views/preview.py
+5
-0
cms/static/js/views/metadata.js
+2
-11
No files found.
cms/djangoapps/contentstore/views/preview.py
View file @
8fbaa66d
...
@@ -17,6 +17,7 @@ from xmodule.exceptions import NotFoundError, ProcessingError
...
@@ -17,6 +17,7 @@ from xmodule.exceptions import NotFoundError, ProcessingError
from
xmodule.library_tools
import
LibraryToolsService
from
xmodule.library_tools
import
LibraryToolsService
from
xmodule.services
import
SettingsService
from
xmodule.services
import
SettingsService
from
xmodule.modulestore.django
import
modulestore
,
ModuleI18nService
from
xmodule.modulestore.django
import
modulestore
,
ModuleI18nService
from
xmodule.mixin
import
wrap_with_license
from
opaque_keys.edx.keys
import
UsageKey
from
opaque_keys.edx.keys
import
UsageKey
from
opaque_keys.edx.locator
import
LibraryUsageLocator
from
opaque_keys.edx.locator
import
LibraryUsageLocator
from
xmodule.x_module
import
ModuleSystem
from
xmodule.x_module
import
ModuleSystem
...
@@ -170,6 +171,10 @@ def _preview_module_system(request, descriptor, field_data):
...
@@ -170,6 +171,10 @@ def _preview_module_system(request, descriptor, field_data):
_studio_wrap_xblock
,
_studio_wrap_xblock
,
]
]
if
settings
.
FEATURES
.
get
(
"LICENSING"
,
False
):
# stick the license wrapper in front
wrappers
.
insert
(
0
,
wrap_with_license
)
descriptor
.
runtime
.
_services
[
'studio_user_permissions'
]
=
StudioPermissionsService
(
request
)
# pylint: disable=protected-access
descriptor
.
runtime
.
_services
[
'studio_user_permissions'
]
=
StudioPermissionsService
(
request
)
# pylint: disable=protected-access
return
PreviewModuleSystem
(
return
PreviewModuleSystem
(
...
...
cms/static/js/views/metadata.js
View file @
8fbaa66d
...
@@ -553,11 +553,6 @@ function(BaseView, _, MetadataModel, AbstractEditor, FileUpload, UploadDialog,
...
@@ -553,11 +553,6 @@ function(BaseView, _, MetadataModel, AbstractEditor, FileUpload, UploadDialog,
});
});
Metadata
.
License
=
AbstractEditor
.
extend
({
Metadata
.
License
=
AbstractEditor
.
extend
({
template
:
_
.
template
(
'<label class="label setting-label" for="list-license-types">'
+
'<%- model.display_name %>'
+
'</label>'
),
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
this
.
licenseModel
=
new
LicenseModel
({
"asString"
:
this
.
model
.
getValue
()});
this
.
licenseModel
=
new
LicenseModel
({
"asString"
:
this
.
model
.
getValue
()});
...
@@ -569,13 +564,9 @@ function(BaseView, _, MetadataModel, AbstractEditor, FileUpload, UploadDialog,
...
@@ -569,13 +564,9 @@ function(BaseView, _, MetadataModel, AbstractEditor, FileUpload, UploadDialog,
},
},
render
:
function
()
{
render
:
function
()
{
this
.
licenseView
.
render
().
$el
.
css
(
"display"
,
"inline"
);
this
.
licenseView
.
undelegateEvents
();
this
.
licenseView
.
undelegateEvents
();
this
.
$el
.
html
(
this
.
template
({
this
.
$el
.
empty
().
append
(
this
.
licenseView
.
el
);
model
:
this
.
model
.
attributes
}));
// make the licenseView display after this template, inline
this
.
licenseView
.
render
().
$el
.
css
(
"display"
,
"inline"
)
this
.
$el
.
append
(
this
.
licenseView
.
el
)
// restore event bindings
// restore event bindings
this
.
licenseView
.
delegateEvents
();
this
.
licenseView
.
delegateEvents
();
return
this
;
return
this
;
...
...
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