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
8a4503b3
Commit
8a4503b3
authored
Apr 08, 2015
by
David Baumgold
Committed by
Sarina Canelake
May 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display Scope.content fields in Studio editor
But mark `data` as non-editable metadata, so that it doesn't appear
parent
fe3326d8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
2 deletions
+51
-2
common/lib/xmodule/xmodule/capa_base.py
+6
-0
common/lib/xmodule/xmodule/discussion_module.py
+6
-0
common/lib/xmodule/xmodule/html_module.py
+24
-0
common/lib/xmodule/xmodule/raw_module.py
+12
-0
common/lib/xmodule/xmodule/x_module.py
+3
-2
No files found.
common/lib/xmodule/xmodule/capa_base.py
View file @
8a4503b3
...
...
@@ -200,6 +200,12 @@ class CapaFields(object):
scope
=
Scope
.
settings
)
@property
def
non_editable_metadata_fields
(
self
):
non_editable_fields
=
super
(
CapaFields
,
self
)
.
non_editable_metadata_fields
non_editable_fields
.
append
(
CapaFields
.
data
)
return
non_editable_fields
class
CapaMixin
(
CapaFields
):
"""
...
...
common/lib/xmodule/xmodule/discussion_module.py
View file @
8a4503b3
...
...
@@ -41,6 +41,12 @@ class DiscussionFields(object):
)
sort_key
=
String
(
scope
=
Scope
.
settings
)
@property
def
non_editable_metadata_fields
(
self
):
non_editable_fields
=
super
(
DiscussionFields
,
self
)
.
non_editable_metadata_fields
non_editable_fields
.
append
(
DiscussionFields
.
data
)
return
non_editable_fields
class
DiscussionModule
(
DiscussionFields
,
XModule
):
js
=
{
...
...
common/lib/xmodule/xmodule/html_module.py
View file @
8a4503b3
...
...
@@ -54,6 +54,12 @@ class HtmlFields(object):
scope
=
Scope
.
settings
)
@property
def
non_editable_metadata_fields
(
self
):
non_editable_fields
=
super
(
HtmlFields
,
self
)
.
non_editable_metadata_fields
non_editable_fields
.
append
(
HtmlFields
.
data
)
return
non_editable_fields
class
HtmlModuleMixin
(
HtmlFields
,
XModule
):
"""
...
...
@@ -299,6 +305,12 @@ class AboutFields(object):
scope
=
Scope
.
content
)
@property
def
non_editable_metadata_fields
(
self
):
non_editable_fields
=
super
(
AboutFields
,
self
)
.
non_editable_metadata_fields
non_editable_fields
.
append
(
AboutFields
.
data
)
return
non_editable_fields
@XBlock.tag
(
"detached"
)
class
AboutModule
(
AboutFields
,
HtmlModuleMixin
):
...
...
@@ -336,6 +348,12 @@ class StaticTabFields(object):
help
=
_
(
"HTML for the additional pages"
)
)
@property
def
non_editable_metadata_fields
(
self
):
non_editable_fields
=
super
(
StaticTabFields
,
self
)
.
non_editable_metadata_fields
non_editable_fields
.
append
(
StaticTabFields
.
data
)
return
non_editable_fields
@XBlock.tag
(
"detached"
)
class
StaticTabModule
(
StaticTabFields
,
HtmlModuleMixin
):
...
...
@@ -370,6 +388,12 @@ class CourseInfoFields(object):
scope
=
Scope
.
content
)
@property
def
non_editable_metadata_fields
(
self
):
non_editable_fields
=
super
(
CourseInfoFields
,
self
)
.
non_editable_metadata_fields
non_editable_fields
.
append
(
CourseInfoFields
.
data
)
return
non_editable_fields
@XBlock.tag
(
"detached"
)
class
CourseInfoModule
(
CourseInfoFields
,
HtmlModuleMixin
):
...
...
common/lib/xmodule/xmodule/raw_module.py
View file @
8a4503b3
...
...
@@ -15,6 +15,12 @@ class RawDescriptor(XmlDescriptor, XMLEditingDescriptor):
"""
data
=
String
(
help
=
"XML data for the module"
,
default
=
""
,
scope
=
Scope
.
content
)
@property
def
non_editable_metadata_fields
(
self
):
non_editable_fields
=
super
(
RawDescriptor
,
self
)
.
non_editable_metadata_fields
non_editable_fields
.
append
(
RawDescriptor
.
data
)
return
non_editable_fields
@classmethod
def
definition_from_xml
(
cls
,
xml_object
,
system
):
return
{
'data'
:
etree
.
tostring
(
xml_object
,
pretty_print
=
True
,
encoding
=
'unicode'
)},
[]
...
...
@@ -44,6 +50,12 @@ class EmptyDataRawDescriptor(XmlDescriptor, XMLEditingDescriptor):
"""
data
=
String
(
default
=
''
,
scope
=
Scope
.
content
)
@property
def
non_editable_metadata_fields
(
self
):
non_editable_fields
=
super
(
EmptyDataRawDescriptor
,
self
)
.
non_editable_metadata_fields
non_editable_fields
.
append
(
EmptyDataRawDescriptor
.
data
)
return
non_editable_fields
@classmethod
def
definition_from_xml
(
cls
,
xml_object
,
system
):
if
len
(
xml_object
)
==
0
and
len
(
xml_object
.
items
())
==
0
:
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
8a4503b3
...
...
@@ -620,8 +620,9 @@ class XModuleMixin(XModuleFields, XBlockMixin):
fields
=
getattr
(
self
,
'unmixed_class'
,
self
.
__class__
)
.
fields
for
field
in
fields
.
values
():
if
field
.
scope
!=
Scope
.
settings
or
field
in
self
.
non_editable_metadata_fields
:
if
field
in
self
.
non_editable_metadata_fields
:
continue
if
field
.
scope
not
in
(
Scope
.
settings
,
Scope
.
content
):
continue
metadata_fields
[
field
.
name
]
=
self
.
_create_metadata_editor_info
(
field
)
...
...
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